コード例 #1
0
        private void UpdateChannelInfo(Channel channel)
        {
            this.Logger.Debug($"Init {(channel.is_channel ? "channel" : "group")} {this.GetReadableName(channel.id)}");

              // Search in unread history for mentions
              if (channel.unread_count > 0)
              {
            using (ManualResetEventSlim waiter = new ManualResetEventSlim())
            {
              this.GetHistoryMethod(channel)(
            x =>
              {
                this.channelsInfo[channel].UnreadMessage = x.messages.Count(this.IsRegularMessage);
                this.channelsInfo[channel].UnreadMention = x.messages.Count(y => this.IsRegularMessage(y) && this.HasMention(this.GetRawMessage(y)));
                waiter.Set();
              },
            channel, null, null, channel.unread_count);
              waiter.Wait(Timeout);
            }
              }
        }
コード例 #2
0
 private bool ShouldMonitor(Channel channel)
 {
     return channel.is_archived == false && ((channel.is_channel && channel.is_member) || channel.is_group);
 }
コード例 #3
0
 private GetHistoryHandler GetHistoryMethod(Channel channel)
 {
     return channel.is_channel
     ? (GetHistoryHandler)this.Client.GetChannelHistory
     : (GetHistoryHandler)this.Client.GetGroupHistory;
 }
コード例 #4
0
ファイル: ChannelAdapter.cs プロジェクト: seanfuture/Slack
 public ChannelAdapter(Channel info, ConnectedInterface connected, SlackClient client)
 {
     this.info = info;
     this.connected = connected;
     this.client = client;
 }
コード例 #5
0
 public Task <GroupMessageHistory> GetGroupHistoryAsync(Channel groupInfo, DateTime?latest = null, DateTime?oldest = null, int?count = null)
 {
     return(GetHistoryAsync <GroupMessageHistory>(groupInfo.id, latest, oldest, count));
 }
コード例 #6
0
 public Task <ChannelMessageHistory> GetChannelHistoryAsync(Channel channelInfo, DateTime?latest = null, DateTime?oldest = null, int?count = null)
 {
     return(GetHistoryAsync <ChannelMessageHistory>(channelInfo.id, latest, oldest, count));
 }