Skip to content

Commit

Permalink
Feeds and Google login Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
socioboard committed Sep 1, 2015
1 parent 25c1a9c commit c84596e
Show file tree
Hide file tree
Showing 51 changed files with 1,009 additions and 395 deletions.
Binary file modified SocioBoard/Socioboard.v12.suo
Binary file not shown.
54 changes: 47 additions & 7 deletions SocioBoard/Socioboard/Controllers/FeedsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ public ActionResult wallposts(string op, string load, string profileid)
lstobject.Add(item);
}
dictwallposts.Add("facebook", lstobject);
return PartialView("_Panel1Partial", dictwallposts);
if (lstFacebookMessage.Count > 0)
{
return PartialView("_Panel1Partial", dictwallposts);
}
else {
return Content("no_data");
}
}

// Commented By Antima
Expand Down Expand Up @@ -149,7 +155,14 @@ public ActionResult AjaxFeeds(string profileid, string load)
lstobject.Add(twittermsg);
}
dictwallposts.Add("facebook", lstobject);
return PartialView("_Panel2Partial", dictwallposts);
if (lstFacebookFeed.Count > 0)
{
return PartialView("_Panel2Partial", dictwallposts);
}
else {
return Content("no_data");
}

}

//Edited by Sumit Gupta
Expand Down Expand Up @@ -299,7 +312,13 @@ public ActionResult TwitterNetworkDetails(string profileid, string load)
lstobject.Add(twitterfeed);
}
dictwallposts.Add("twitter", lstobject);
return PartialView("_Panel1Partial", dictwallposts);
if (lstTwitterFeed.Count > 0)
{
return PartialView("_Panel1Partial", dictwallposts);
}
else {
return Content("no_data");
}
}

// Commented By Antima
Expand Down Expand Up @@ -348,7 +367,13 @@ public ActionResult TwitterFeeds(string profileid, string load)
lstobject.Add(twittermsg);
}
dictwallposts.Add("twitter", lstobject);
return PartialView("_Panel2Partial", dictwallposts);
if (lstTwitterMessage.Count > 0)
{
return PartialView("_Panel2Partial", dictwallposts);
}
else {
return Content("no_data");
}
}

// Commented By Antima
Expand Down Expand Up @@ -398,7 +423,14 @@ public ActionResult linkedinwallposts(string profileid, string load)
lstobject.Add(item);
}
dictwallposts.Add("linkedin", lstobject);
return PartialView("_Panel1Partial", dictwallposts);
if (lstLinkedInFeed.Count > 0)
{
return PartialView("_Panel1Partial", dictwallposts);
}
else {
return Content("no_data");
}

}
//Vikash[03-04-2015]
//public ActionResult LinkedinFeeds(string profileid)
Expand Down Expand Up @@ -448,7 +480,14 @@ public ActionResult LinkedinFeeds(string profileid, string load)
lstobject.Add(linkledinfeed);
}
dictwallposts.Add("linkedin", lstobject);
return PartialView("_Panel2Partial", dictwallposts);
if (lstLinkedInMessage.Count > 0)
{
return PartialView("_Panel2Partial", dictwallposts);
}
else {
return Content("no_data");
}

}


Expand Down Expand Up @@ -619,12 +658,13 @@ public ActionResult YoutubeChannelVideos(string profileid)
{
lstComment = new List<object>();
lstobject = (object)item["snippet"]["thumbnails"]["maxres"]["url"].ToString();
dic_youtube.Add(lstobject, lstComment);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
dic_youtube.Add(lstobject, lstComment);

}
dictwallposts.Add("youtube", dic_youtube);
return PartialView("_ImagePartial", dictwallposts);
Expand Down
8 changes: 4 additions & 4 deletions SocioBoard/Socioboard/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public ActionResult Index()
return View(User);
}
else {
return RedirectToAction("Index", "Index");
return RedirectToAction("UserActivationByEmail", "Index", new { email = objUser.EmailId });
}
}
}
Expand Down Expand Up @@ -418,7 +418,7 @@ public ActionResult ComposeMessageSend(string message, string allprofiles, strin


Api.ScheduledMessage.ScheduledMessage objAddComposeSentMessage = new Api.ScheduledMessage.ScheduledMessage();
objAddComposeSentMessage.AddComposeMessage(objGroups.UserId.ToString(), profileid, profiletype, message);
objAddComposeSentMessage.AddComposeMessage(objGroups.UserId.ToString(), profileid, profiletype, message, file);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -518,7 +518,7 @@ public ActionResult DisplayCount()
Api.TwitterMessage.TwitterMessage objTwitterMessage = new Api.TwitterMessage.TwitterMessage();
objTwitterMessage.Timeout = 300000;
//twtmsgcount = ((List<TwitterMessage>)(new JavaScriptSerializer().Deserialize(objTwitterMessage.getAlltwtMessages1(TwtProfileId, objUser.Id.ToString()), typeof(List<TwitterMessage>)))).Count;
twtmsgcount = objTwitterMessage.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId);
twtmsgcount = objTwitterMessage.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), TwtProfileId);
}
catch (Exception ex)
{
Expand All @@ -529,7 +529,7 @@ public ActionResult DisplayCount()
Api.ScheduledMessage.ScheduledMessage objScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
objScheduledMessage.Timeout = 300000;
//allsentmsgcount = ((List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(objScheduledMessage.getAllSentMessageDetails(AllProfileId, objUser.Id.ToString()), typeof(List<ScheduledMessage>)))).Count;
allsentmsgcount = objScheduledMessage.GetSentMessageCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId);
allsentmsgcount = objScheduledMessage.GetSentMessageCountByProfileIdAndUserId(objUser.Id.ToString(), AllProfileId);

}
catch (Exception ex)
Expand Down
26 changes: 11 additions & 15 deletions SocioBoard/Socioboard/Controllers/IndexController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using System.Text;
using System.Web.Security;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;

namespace Socioboard.Controllers
{
Expand All @@ -23,6 +25,8 @@ public class IndexController : BaseController
// [OutputCache(Duration = 604800)]
public ActionResult Index()
{


if (Session["User"] != null)
{
if (!string.IsNullOrEmpty(((User)Session["User"]).EmailId) && !string.IsNullOrEmpty(((User)Session["User"]).Password))
Expand Down Expand Up @@ -84,7 +88,7 @@ public async System.Threading.Tasks.Task<ActionResult> AjaxLogin(string username
}
else if (str.Equals("Email Not Exist"))
{
returnmsg = "Sorry, Socioboard doesn't recognize that username.";
returnmsg = "Sorry, " + ConfigurationManager.AppSettings["domain"] + " doesn't recognize that username.";
return Content(returnmsg);
}
else
Expand Down Expand Up @@ -248,19 +252,10 @@ public ActionResult Signup()
line = sr.ReadToEnd();
JObject jo = JObject.Parse(line);
user.PaymentStatus = "unpaid";
//if (!string.IsNullOrEmpty(Request.QueryString["type"]))
//{
// user.AccountType = Request.QueryString["type"];

// ViewBag.DropDownList1 = Request.QueryString["type"];
//}
//else
//{
// user.AccountType = "Free";
//}

user.AccountType = Server.UrlDecode((string)jo["package"]);
user.CreateDate = DateTime.Now;
user.ExpiryDate = DateTime.Now.AddMonths(1);
user.ExpiryDate = DateTime.Now.AddDays(30);
user.Id = Guid.NewGuid();
user.UserName = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
user.EmailId = Server.UrlDecode((string)jo["email"]);
Expand Down Expand Up @@ -440,12 +435,13 @@ public ActionResult RemainingDays()
}
else if (daysremaining == 0)
{
remainingday = "Your trial " + objUser.AccountType.ToString() + " account will expire Today please upgrade to paid plan.";
//remainingday = "Your trial " + objUser.AccountType.ToString() + " account will expire Today please upgrade to paid plan.";
remainingday = objUser.AccountType.ToString() + "##" + daysremaining.ToString();
}
else
{
remainingday = "Your trial " + objUser.AccountType.ToString() + " account will expire in " + daysremaining + " days, please upgrade to paid plan.";

//remainingday = "Your trial " + objUser.AccountType.ToString() + " account will expire in " + daysremaining + " days, please upgrade to paid plan.";
remainingday = objUser.AccountType.ToString() + "##" + daysremaining.ToString();
}
}
}
Expand Down
15 changes: 13 additions & 2 deletions SocioBoard/Socioboard/Controllers/InstagramManagerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ public ActionResult Instagram()
}
catch (Exception ex)
{
logger.Error("Instagram =>" + ex.StackTrace);
logger.Error("Instagram =>" + ex.Message);
Console.WriteLine(ex.Message);
}

logger.Error("Instagram =>" + AddTwitterAccount);
if (Session["SocialManagerInfo"] == null)
{
return RedirectToAction("Index", "Home");
Expand Down Expand Up @@ -67,13 +69,15 @@ public ActionResult AuthenticateInstagram()
logger.Error("ex.Message : " + ex.Message);
logger.Error("ex.StackTrace : " + ex.StackTrace);
}

logger.Error("AuthenticateInstagram => " + Convert.ToString(group["GroupName"]) + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
{
if (profilecount < totalaccount)
{
logger.Error("AuthenticateInstagram => " + profilecount.ToString());
Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
logger.Error("AuthenticateInstagram => redirect uri =>" + redirecturl);
if (redirecturl.Contains("FacebookManager") || redirecturl.Contains("Facebook"))
{
redirecturl = redirecturl.Replace("FacebookManager", "InstagramManager").Replace("Facebook", "Instagram");
Expand All @@ -89,6 +93,7 @@ public ActionResult AuthenticateInstagram()
{
Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
logger.Error("AuthenticateInstagram => redirect uri =>" + redirecturl);
if (redirecturl.Contains("FacebookManager") || redirecturl.Contains("Facebook"))
{
redirecturl = redirecturl.Replace("FacebookManager","InstagramManager").Replace("Facebook","Instagram");
Expand All @@ -103,20 +108,26 @@ public ActionResult AuthenticateInstagram()
else
{
//return JavaScript("alert(\"You can't add more than "+ totalaccount +" account!\")");
logger.Error("AuthenticateInstagram => profilecount issue");
return RedirectToAction("Index", "Home");
}
}
else
{
logger.Error("AuthenticateInstagram => groupIssue");
return RedirectToAction("Index", "Home");
}
}
catch (Exception ex)
{
logger.Error("AuthenticateInstagram =>" +ex.StackTrace);
logger.Error("AuthenticateInstagram =>" + ex.Message);
}
}
catch (Exception ex)
{
logger.Error("AuthenticateInstagram =>" + ex.StackTrace);
logger.Error("AuthenticateInstagram =>" + ex.Message);
}
return RedirectToAction("Index", "Home");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public ActionResult Youtube()
}
else
{
objUser.ActivationStatus = "1";
Session["User"] = objUser;
return RedirectToAction("Registration", "Index");
}
Expand Down
Loading

0 comments on commit c84596e

Please sign in to comment.