Exemple #1
0
 public void GetDirectMessageHistory(Action <MessageHistory> callback, DirectMessageConversation conversationInfo, DateTime?latest = null, DateTime?oldest = null, int?count = null, bool?unreads = false)
 {
     GetHistory(callback, conversationInfo.id, latest, oldest, count, unreads);
 }
        private void UpdateChannelInfo(DirectMessageConversation im)
        {
            this.Logger.Debug($"Init IM {this.GetReadableName(im.id)}");

              // Search in unread history
              if (im.unread_count > 0)
              {
            using (ManualResetEventSlim waiter = new ManualResetEventSlim())
            {
              this.Client.GetDirectMessageHistory(
            x =>
            {
              this.channelsInfo[im].UnreadMessage = x.messages.Count(this.IsRegularMessage);
              this.channelsInfo[im].UnreadMention = this.channelsInfo[im].UnreadMessage;
              waiter.Set();
            },
            im, null, null, im.unread_count);
              waiter.Wait(Timeout);
            }
              }
        }
Exemple #3
0
 public Task <MessageHistory> GetDirectMessageHistoryAsync(DirectMessageConversation conversationInfo, DateTime?latest = null, DateTime?oldest = null, int?count = null, bool?unreads = false)
 {
     return(GetHistoryAsync <MessageHistory>(conversationInfo.id, latest, oldest, count, unreads));
 }
 private bool ShouldMonitor(DirectMessageConversation im)
 {
     return im.is_user_deleted == false;
 }
Exemple #5
0
 public Task <MessageHistory> GetDirectMessageHistoryAsync(DirectMessageConversation conversationInfo, DateTime?latest = null, DateTime?oldest = null, int?count = null, bool?inclusive = null)
 {
     return(GetHistoryAsync <MessageHistory>(conversationInfo.id, latest, oldest, count, inclusive));
 }