Example #1
0
        protected void UpdateStatus()
        {
            foreach (var channelInfo in this.channelsInfo.Where(x => x.Value.UnreadMessage > 0 || x.Value.UnreadMention > 0))
            {
                this.Logger.Debug($"Name: {this.GetReadableName(channelInfo.Key)} - UnreadMessage: {channelInfo.Value.UnreadMessage} - UnreadMention: {channelInfo.Value.UnreadMention}");
            }

            this.HasUnreadMessages = this.channelsInfo.Any(x => x.Value.UnreadMessage > 0);
            this.HasUnreadMentions = this.channelsInfo.Any(x => x.Value.UnreadMention > 0);

            this.Client.GetPresence(
                x =>
            {
                this.UserPresence = x;
                this.UpdatePresenceStatus();
            }
                , this.Client.MySelf.id);



            //this.Client.HandlePresence()

            this.Logger.Debug($"HasUnreadMention: {this.HasUnreadMentions}");
            this.Logger.Debug($"HasUnreadMessage: {this.HasUnreadMessages}");

            this.Changed?.Invoke();
        }
Example #2
0
 protected void OnPresenceChange()
 {
     this.Client.GetPresence(
         x =>
     {
         this.UserPresence = x;
         this.UpdatePresenceStatus();
     }
         , this.Client.MySelf.id);
 }