Skip to content

Commit

Permalink
Socioboard 3.0 Update
Browse files Browse the repository at this point in the history
Github Commit
—----------------------------------
1.changes for Comment issue in instagram reports
2.changes for total number of follower count
3.changes for changes for all instagram feeds
4.Admin panel Loader
5.inbox message/sent message/smart inbox ">if it take time to fetch
data, please add wait circle in there  so user can get to know something
is going in background
6.Loading Loadmore for fb feeds
7.Loading Loadmore for Twitter feeds and tweets
8.Loading Loadmore for instagram and google plus
9.Pricing load more issue...it takes more time to load prices
10.if zoom in browser then the ui changed issue fixed
11.changes for google login image
12.add loader in dashboard
13.change error message in signup
14.forgot password issue
15.email verification issue restore issue
16.changes for forget password if account is  deactive
17.compose message and schedule message issue for fanpage
18.twitter profile image thatchange are not reflecting in dash board
19.facebook group post>symbols are coming in facebook group post
and same sysmbols are reflecting in scheduling message.
20.facebook group post compose message
21.Upgrade plan profile adding bugs.
22.select all option in compose section.
  • Loading branch information
socioboard committed Feb 6, 2017
1 parent 0b94647 commit fd614ee
Show file tree
Hide file tree
Showing 186 changed files with 1,541 additions and 177,712 deletions.
32 changes: 21 additions & 11 deletions src/Api.Socioboard/Controllers/FacebookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IActionResult AddFacebookAccount(string accessToken, long groupId, long u
Domain.Socioboard.Models.Facebookaccounts fbacc = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(Convert.ToString(profile["id"]), _redisCache, dbr);
if (fbacc != null && fbacc.IsActive == true)
{
if(fbacc.UserId == userId)
if (fbacc.UserId == userId)
{
return Ok("Facebook account already added by you.");
}
Expand Down Expand Up @@ -208,7 +208,7 @@ public IActionResult GetTopFeeds(string profileId, long userId, int skip, int co
{
if (skip + count < 100)
{
return Ok(Repositories.FacebookRepository.GetTopFacebookFeed(profileId, userId, _redisCache, _appSettings,skip,count));
return Ok(Repositories.FacebookRepository.GetTopFacebookFeed(profileId, userId, _redisCache, _appSettings, skip, count));
}
else
{
Expand Down Expand Up @@ -238,10 +238,10 @@ public IActionResult GetTopFeeds(string profileId, long userId, int skip, int co
_intafeed._facebookComment = lstFbPostComment.ToList();
lstfacebookfeed.Add(_intafeed);
}
return Ok(lstfacebookfeed);
return Ok(lstfacebookfeed);

}
// return Ok();
// return Ok();
}

[HttpGet("GetFacebookProfiles")]
Expand All @@ -268,7 +268,7 @@ public IActionResult GetFacebookPages(string accesstoken, long groupId)
try
{
List<Domain.Socioboard.Models.Facebookpage> lstpages = new List<Facebookpage>();
lstpages = Fbpages.Getfacebookpages(accesstoken);
lstpages = Fbpages.Getfacebookpages(accesstoken);
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
List<Domain.Socioboard.Models.Groupprofiles> lstGrpProfiles = Repositories.GroupProfilesRepository.getGroupProfiles(groupId, _redisCache, dbr);
lstGrpProfiles = lstGrpProfiles.Where(t => t.profileType == Domain.Socioboard.Enum.SocialProfileType.FacebookFanPage).ToList();
Expand All @@ -292,10 +292,11 @@ public IActionResult AddFacebookPages(long userId, long groupId)
{
string data = Request.Form["profileaccesstoken"];
string[] accesstoken = data.Split(',');
int addedPageCount = 0;
foreach (var item in accesstoken)
{
dynamic profile = Fbpages.getFbPageData(item);
// string subscribed_apps= Fbpages.subscribed_apps(item, Convert.ToString(profile["id"]));
// string subscribed_apps= Fbpages.subscribed_apps(item, Convert.ToString(profile["id"]));
try
{
string x = Convert.ToString(profile);
Expand All @@ -310,7 +311,8 @@ public IActionResult AddFacebookPages(long userId, long groupId)
Domain.Socioboard.Models.Facebookaccounts fbacc = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(Convert.ToString(profile["id"]), _redisCache, dbr);
if (fbacc != null && fbacc.IsActive == true)
{
return Ok("Facebook Page added by other user.");
addedPageCount++;
//return Ok("Facebook Page added by other user.");
}
else
{
Expand All @@ -324,6 +326,14 @@ public IActionResult AddFacebookPages(long userId, long groupId)

}
}
if (addedPageCount == accesstoken.Length)
{
return Ok("Facebook Page added by other user.");
}
else if (addedPageCount > 0)
{
return Ok("Pages added successfully and " + addedPageCount + " pages added by other user");
}
return Ok("Page added successfully");
}

Expand All @@ -339,7 +349,7 @@ public IActionResult PostFacebookComment(string postId, string profileId, string
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
string postcomment = Repositories.FacebookRepository.PostFacebookComment(dbr, message, profileId, postId, _redisCache, _appSettings, _logger);
if(postcomment.Contains("Invalid Access Token"))
if (postcomment.Contains("Invalid Access Token"))
{
return Ok("Invalid Access Token");
}
Expand Down Expand Up @@ -370,7 +380,7 @@ public IActionResult FacebookfanPageCount(long userId, long groupId)
}

[HttpGet("AddFacebookPagesByUrl")]
public IActionResult AddFacebookPagesByUrl(long userId, long groupId,string url)
public IActionResult AddFacebookPagesByUrl(long userId, long groupId, string url)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
Domain.Socioboard.Models.Facebookpage _facebookpages = Helper.FacebookHelper.GetFbPageDetails(url, _appSettings);
Expand All @@ -380,7 +390,7 @@ public IActionResult AddFacebookPagesByUrl(long userId, long groupId,string url)
{
return Ok("Facebook Page added by other user");
}
if (_facebookpages!=null)
if (_facebookpages != null)
{
int adddata = Repositories.FacebookRepository.AddFacebookPagesByUrl(_facebookpages, dbr, userId, groupId, Domain.Socioboard.Enum.FbProfileType.FacebookPublicPage, _facebookpages.AccessToken, _redisCache, _appSettings, _logger);
if (adddata == 1)
Expand All @@ -390,7 +400,7 @@ public IActionResult AddFacebookPagesByUrl(long userId, long groupId,string url)
else
{
return Ok("issue in adding");
}
}
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/Api.Socioboard/Controllers/GoogleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ public IActionResult AddGaSites(long groupId, long userId)
string data = Request.Form["profileaccesstoken"];
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
string[] profiledata = null;
int i = 0;

profiledata = data.Split(',');
foreach (var item in profiledata)
{
int j = Repositories.GplusRepository.AddGaSites(item, userId, groupId, _redisCache, _appSettings, dbr,_appEnv);
}

return Ok("Added Successfully");
}

Expand Down
20 changes: 12 additions & 8 deletions src/Api.Socioboard/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public IActionResult Register(User user)
IList<User> lstUser = dbr.Find<User>(t => t.EmailId.Equals(user.EmailId));
if (lstUser != null && lstUser.Count() > 0)
{
return BadRequest("EmailID Exist");
return BadRequest("This Email is already registered please login to continue");
}
IList<User> lstUser1 = dbr.Find<User>(a => a.PhoneNumber.Equals(user.PhoneNumber));
if (lstUser1 != null && lstUser1.Count() > 0)
Expand Down Expand Up @@ -495,16 +495,16 @@ public IActionResult UpdatePackageAdmin(string amount, long id)
if (res == 1)
{
//_redisCache.Delete(package.EmailId);
return Ok("package detail updated");
return Ok("Package detail updated");
}
else
{
return Ok("issue while updating.");
return Ok("Issue while updating.");
}
}
else
{
return NotFound("package not found");
return NotFound("Package not found");
}
}

Expand Down Expand Up @@ -838,7 +838,7 @@ public IActionResult ResendMail(string Email)
string html = System.IO.File.ReadAllText(path);
html = html.Replace("[FirstName]", user.FirstName);
html = html.Replace("[AccountType]", user.AccountType.ToString());
html = html.Replace("[ActivationLink]", "http://localhost:9821/Home/Active?Token=" + user.EmailValidateToken + "&id=" + user.Id);
html = html.Replace("[ActivationLink]", _appSettings.Domain+"/Home/Active?Token=" + user.EmailValidateToken + "&id=" + user.Id);


_emailSender.SendMailSendGrid(_appSettings.frommail, "", user.EmailId, "", "", "Socioboard Email conformation Link", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
Expand Down Expand Up @@ -1221,11 +1221,15 @@ public IActionResult ForgotPasswordSendMail(string emailId)
}
else if (user.EmailValidateToken.Equals("Facebook"))
{
return Ok("Password reset is not permitted as you have loggedin through Facebook, please login with Facebook.");
return Ok("Password reset is not permitted as the email address you have entered is already registered in Socioboard with Facebook. Please login through Facebook.");
}
else if (user.EmailValidateToken.Equals("Google"))
{
return Ok("Password reset is not permitted as you have loggedin through Google, please login with Google.");
return Ok("Password reset is not permitted as the email address you have entered is already registered in Socioboard with Google. Please login through Google.");
}
else if (user.ActivationStatus == Domain.Socioboard.Enum.SBUserActivationStatus.MailSent)
{
return Ok("Please verify your email address before resetting your password");
}
user.forgotPasswordKeyToken = SBHelper.RandomString(20);
user.forgotPasswordExpireDate = DateTime.UtcNow.AddDays(1);
Expand Down Expand Up @@ -1484,7 +1488,7 @@ public IActionResult UpdateTrialStatus(Int64 Id)


[HttpGet("GetPlans")]
public IActionResult GetPlans(long groupId)
public IActionResult GetPlans()
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
List<Package> lstplan = dbr.Find<Package>(t => t.id<8).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Compat.Web;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Api.Socioboard.Repositories.ListeningRepository
Expand All @@ -31,6 +33,42 @@ public class FacebookGroupPostRepository
return await result;
});
IList<Domain.Socioboard.Models.Listening.FaceBookGroupPost> lstFbFeeds = task.Result;
for (int i=0;i<lstFbFeeds.Count;i++)
{
// lstFbFeeds[i].Message = lstFbFeeds[i].Message.Replace("%20"," ").Replace("21%", " ").Replace("2%"," ").Replace("\n"," ").Replace("%3F"," ").Replace("% 21"," ");

//lstFbFeeds[i].Message = Regex.Replace(lstFbFeeds[i].Message,"[%21%27%21%22]"," ");
lstFbFeeds[i].Message = lstFbFeeds[i].Message.Replace("\\n", " ").Replace("\\r"," ");
lstFbFeeds[i].Message = HttpUtility.UrlDecode(lstFbFeeds[i].Message);
}



//foreach(IList<Domain.Socioboard.Models.Listening.FaceBookGroupPost> lstFbFeedss in lstFbFeeds)
// {
// lstFbFeedss.First().Message= lstFbFeedss.First().Message.Replace("%", "");
// //lstFbFeeds.FirstOrDefault().Message = lstFbFeeds.FirstOrDefault().Message.Replace("%", "");
// }
//lstFbFeeds.find.Message = lstFbFeeds.First().Message.Replace("%", "");
//lstFbFeeds.FirstOrDefault().Message= lstFbFeeds.FirstOrDefault().Message.Replace("%", "");

//for (int i = 0; i < lstFbFeeds.Count; i++)
//{
// //string data = lstFbFeeds[i].Message;
// lstFbFeeds.First().Message = lstFbFeeds.First().Message.Replace("%", "");
//}

//foreach(IList<Domain.Socioboard.Models.Listening.FaceBookGroupPost> acc in lstFbFeeds)
//{
// foreach(object mess in acc)
// {
// string message = mess.ToString();
// }
//}

//List<FacebookGroupPostRepository> lists = new List<FacebookGroupPostRepository>();


if (lstFbFeeds.Count > 0)
{
// _redisCache.Set(Domain.Socioboard.Consatants.SocioboardConsts.CacheDiscoveryFacebookGroupPost + keyword, lstFbFeeds.ToList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.Threading.Tasks;
using System.Web;
using System.Net;
using System.Text.RegularExpressions;
using System.Compat.Web;

namespace Api.Socioboard.Repositories.ListeningRepository
{
Expand Down Expand Up @@ -43,9 +45,20 @@ public class LinkedInGroupPostRepository
{
return await result;
});
IList<Domain.Socioboard.Models.Listening.LinkedGroupPost> lstFbFeeds = task.Result;
lstFbFeeds.Select(s => { s.Message = WebUtility.HtmlDecode(s.Message); return s; }).ToList();
return lstFbFeeds.ToList();
IList<Domain.Socioboard.Models.Listening.LinkedGroupPost> lstLinkFeeds = task.Result;

for (int i = 0; i < lstLinkFeeds.Count; i++)
{
//lstLinkFeeds[i].Message = lstLinkFeeds[i].Message.Replace("%3F", " ").Replace("% 21", " ").Replace("%2C", " ");
//lstLinkFeeds[i].Message = Regex.Replace(lstLinkFeeds[i].Message, "[|%21 %27 %21 %22]"," ");
// // lstLinkFeeds[i].Message = Regex.Replace(lstLinkFeeds[i].Message, @"\r\n?|\n", " ");
lstLinkFeeds[i].Message= lstLinkFeeds[i].Message.Replace("\\n"," ").Replace("\\r", " ");
lstLinkFeeds[i].Message = System.Compat.Web.HttpUtility.UrlDecode(lstLinkFeeds[i].Message);

}

lstLinkFeeds.Select(s => { s.Message = WebUtility.HtmlDecode(s.Message); return s; }).ToList();
return lstLinkFeeds.ToList();
}
catch (Exception ex)
{
Expand Down
14 changes: 10 additions & 4 deletions src/Api.Socioboard/Repositories/TwitterRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,21 @@ public static string TwitterFollowerCount(long userId, long groupId, Model.Datab
long TwitterFollowerCount = dbr.Find<Domain.Socioboard.Models.TwitterAccount>(t => profileids.Contains(t.twitterUserId) && t.isActive).Sum(t => t.followersCount);
if (TwitterFollowerCount > 1000000)
{
long r = TwitterFollowerCount % 1000000;
float r = TwitterFollowerCount % 1000000;
long t = TwitterFollowerCount / 1000000;
FollowerCount = t.ToString() + "." + (r / 10000).ToString() + "M";
float s= r / 1000000;
float result= t + s;
FollowerCount = result + " M";
}
else if (TwitterFollowerCount > 1000)
{
long r = TwitterFollowerCount % 1000;
float r = TwitterFollowerCount % 1000;
long t = TwitterFollowerCount / 1000;
FollowerCount = t.ToString() + "." + (r / 100).ToString() + "K";
float s = r/1000;
float result = t + s;
FollowerCount = result+ " K"
/*FollowerCount = t.ToString() + s.ToString() + "K"*/
;
}
else
{
Expand Down
Binary file modified src/Api.Socioboard/bin/Debug/net451/Api.Socioboard.exe
Binary file not shown.
Binary file modified src/Api.Socioboard/bin/Debug/net451/Api.Socioboard.pdb
Binary file not shown.
Binary file modified src/Api.Socioboard/bin/Debug/net451/win7-x86/Api.Socioboard.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fd614ee

Please sign in to comment.