Example #1
0
        public void SendResponseToRequest(int requestorID, string requestResponse, int endUserID)
        {
            var notificationID = _UserRepo.ResponseToFriendRequest(requestorID, requestResponse, endUserID);

            if (notificationID > 0)
            {
                var connectionId = _UserRepo.GetUserConnectionID(endUserID);
                if (connectionId != null && connectionId.Count() > 0)
                {
                    Clients.Clients(connectionId).RemoveNotification(notificationID);
                }
            }
            if (requestResponse == "Accepted")
            {
                SendNotification(endUserID, requestorID, "FriendRequestAccepted");
                List <string> connectionIds = _UserRepo.GetUserConnectionID(new int[] { endUserID, requestorID });
                RefreshOnlineUsersByConnectionIds(connectionIds);
            }
        }