Esempio n. 1
0
        private void OnImMarked(ImMarked message)
        {
            this.Logger.Debug($"Received => Type: {message.type} - SubType: {message.subtype} - Channel: {this.GetReadableName(message.channel)} - Raw: {this.GetRawMessage(message)}");

            if (this.ShouldMonitor(message.channel))
            {
                var directMessageConversation = this.Client.DirectMessageLookup[message.channel];
                var channelNotification       = this.channelsInfo[directMessageConversation];

                this.Client.GetDirectMessageHistory(
                    x =>
                {
                    var messages = x.messages.Where(y => y.ts > message.ts).ToArray();
                    channelNotification.UnreadMessage = messages.Count(y => y.user != this.Client.MySelf.id);
                    channelNotification.UnreadMention = channelNotification.UnreadMessage;
                    this.UpdateStatus();
                },
                    directMessageConversation, null, message.ts, HistoryItemsToFetch);
            }
            else
            {
                this.Logger.Debug("Message dropped");
            }
        }
        private void OnImMarked(ImMarked message)
        {
            this.Logger.Debug($"Received => Type: {message.type} - SubType: {message.subtype} - Channel: {this.GetReadableName(message.channel)} - Raw: {this.GetRawMessage(message)}");

              if (this.ShouldMonitor(message.channel))
              {
            var directMessageConversation = this.Client.DirectMessageLookup[message.channel];
            var channelNotification = this.channelsInfo[directMessageConversation];

            this.Client.GetDirectMessageHistory(
              x =>
              {
            var messages = x.messages.Where(y => y.ts > message.ts).ToArray();
            channelNotification.UnreadMessage = messages.Count(y => y.user != this.Client.MySelf.id);
            channelNotification.UnreadMention = channelNotification.UnreadMessage;
            this.UpdateStatus();
              },
              directMessageConversation, null, message.ts, HistoryItemsToFetch);
              }
              else
              {
            this.Logger.Debug("Message dropped");
              }
        }