Esempio n. 1
0
        public async void SendChatMessagesReadNodeNoticeAsync(List <MessageDto> messages, long chatId, long requestorId)
        {
            try
            {
                IEnumerable <long> nodesIds = await _loadChatsService.GetChatNodeListAsync(chatId).ConfigureAwait(false);

                MessagesReadNodeNotice notice = new MessagesReadNodeNotice(messages.Select(message => message.GlobalId).ToList(), ConversationType.Chat, chatId, requestorId);
                await SendNoticeToNodesAsync(notice, nodesIds).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex);
            }
        }
Esempio n. 2
0
 public MessagesReadNoticeHandler(NodeNotice notice,
                                  NodeConnection current,
                                  IConversationsNoticeService conversationsNoticeService,
                                  IUpdateMessagesService updateMessagesService,
                                  IUpdateChatsService updateChatsService,
                                  ILoadDialogsService loadDialogsService,
                                  IUpdateChannelsService updateChannelsService)
 {
     this.notice  = (MessagesReadNodeNotice)notice;
     this.current = current;
     this.conversationsNoticeService = conversationsNoticeService;
     this.updateMessagesService      = updateMessagesService;
     this.updateChatsService         = updateChatsService;
     this.loadDialogsService         = loadDialogsService;
     this.updateChannelsService      = updateChannelsService;
 }
Esempio n. 3
0
 public async void SendDialogMessagesReadNoticeAsync(IEnumerable <Guid> messagesId, UserVm senderUser, UserVm receiverUser)
 {
     try
     {
         List <long> nodesId = new List <long>
         {
             senderUser.NodeId.GetValueOrDefault(),
                     receiverUser.NodeId.GetValueOrDefault()
         };
         MessagesReadNodeNotice notice = new MessagesReadNodeNotice(
             messagesId, ConversationType.Dialog, receiverUser.Id.GetValueOrDefault(), senderUser.Id.GetValueOrDefault());
         await SendNoticeToNodesAsync(notice, nodesId).ConfigureAwait(false);
     }
     catch (Exception ex)
     {
         Logger.WriteLog(ex);
     }
 }