summaryrefslogtreecommitdiff
path: root/Project-Unite/ACL.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-23 21:50:48 -0400
committerMichael <[email protected]>2017-03-23 21:50:48 -0400
commit0b2469ee1c836c0022f1d10d24dbd0055011c43a (patch)
tree1fcfe2eaa8b87e18436da602f1faeb6487467062 /Project-Unite/ACL.cs
parent8d7350c24ac95eb325ce9c653c4cb7c99fbcdcae (diff)
downloadproject-unite-0b2469ee1c836c0022f1d10d24dbd0055011c43a.tar.gz
project-unite-0b2469ee1c836c0022f1d10d24dbd0055011c43a.tar.bz2
project-unite-0b2469ee1c836c0022f1d10d24dbd0055011c43a.zip
Front-end for following/un-following
Diffstat (limited to 'Project-Unite/ACL.cs')
-rw-r--r--Project-Unite/ACL.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs
index dc12487..73636c7 100644
--- a/Project-Unite/ACL.cs
+++ b/Project-Unite/ACL.cs
@@ -28,6 +28,13 @@ namespace Project_Unite
return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md)));
}
+ public static bool IsFollowed(string you, string fId)
+ {
+ var db = new ApplicationDbContext();
+ var uid = db.Users.FirstOrDefault(x => x.UserName == you).Id;
+ return db.Follows.FirstOrDefault(x => x.Follower == uid && x.Followed == fId) != null;
+ }
+
public static IHtmlString UserLink(this HtmlHelper hpr, string userId)
{
using(var db = new ApplicationDbContext())