Beispiel #1
0
        public int AcceptUserFriendship(JObject jObj)
        {
            string fromUserId     = jObj["fromUserId"].ToString();
            string toUserId       = jObj["toUserId"].ToString();
            string notificationId = jObj["notificationId"].ToString();

            //Deleção da notificação original de pedido de amizade
            Nr.RemoveNotification(Int32.Parse(notificationId));

            Notification notification = new Notification()
            {
                Message                   = $"{GetUserById(fromUserId).Name} aceitou seu pedido de amizade.",
                NotificationTime          = DateTime.Now,
                WasRead                   = false,
                NotificationIssuerId      = fromUserId,
                NotifiedApplicationUserId = toUserId
            };

            //Criação da notificação para o solicitante, informando que o pedido de amizade foi aceito
            Nr.Add(notification);

            return(Ar.AcceptUserFriendship(fromUserId, toUserId));
        }