コード例 #1
0
ファイル: ChatHub.cs プロジェクト: saidmahmoud/SUMU_Messenger
        public void ConfirmRead(string notificationId, bool applyOnPreviouslyReceived)
        {
            Models.User user;
            if (AuthorizedUser(out user))
            {
                DataClassesManager.InsertLog(string.Format("{0}-{1}", notificationId, applyOnPreviouslyReceived.ToString()), "SignalR", "ConfirmRead", Context.ConnectionId, string.Format("{0}-{1}", user.UserId, user.Username));

                string recipientId = string.Empty;
                var    update      = DataClassesManager.NotificationRead(user.UserId, notificationId, applyOnPreviouslyReceived);
                if (update != null)
                {
                    var recipientConnectionId = _connections.GetConnectionId(update.Recipient_Id);
                    if (!string.IsNullOrEmpty(recipientConnectionId))
                    {
                        Clients.Client(recipientConnectionId).MyMessageRead(update.Id, update.Content, applyOnPreviouslyReceived);
                    }
                }
            }
        }