public ActionResult CreateGameInvitation(String[] invitedUsers) { User u = gc.getUserFromIdentity(User); GameInvitationLogic.CreateNewInvitation(u, invitedUsers, gc); return(RedirectToAction("Friends")); }
public ActionResult DeclineGameInvitation(String username, String invitedUser1, String invitedUser2, String invitedUser3) { User current = gc.getUserFromIdentity(User); User u = gc.GetUser(username); User u1 = gc.GetUser(invitedUser1); User u2 = gc.GetUser(invitedUser2); User u3 = gc.GetUser(invitedUser3); GameInvitation gi = GameInvitationLogic.getGameInvitation(u, u1, u2, u3, gc); GameInvitationLogic.DeclineInvitation(current, gi, gc); return(RedirectToAction("Friends")); }
public ActionResult Friends() { if (!User.Identity.IsAuthenticated) { return(View("NotAuthorized")); } User u = gc.getUserFromIdentity(User); String[] friends = FriendLogic.getFriends(u, gc); String[] pendingFriendRequests = FriendLogic.getFriendRequestNotifications(u, gc); InvitationViewModel vm = new InvitationViewModel(pendingFriendRequests, friends, GameInvitationLogic.getGameInvitationNotifications(u, gc)); return(View(vm)); }