Beispiel #1
0
        public void handleUnreadMessage(ChannelMessageView message, string userId)
        {
            if (message.mentionEveryone || message.mentions.Any(user => user.id == userId))
            {
                this.mentioned += 1;
                this.atMe       = true;
            }

            this.atAll   = this.atAll || message.mentionEveryone;
            this.unread += 1;
        }
Beispiel #2
0
 public void updateFromSocketResponseUpdateChannelData(SocketResponseUpdateChannelData channel)
 {
     this.id          = channel?.id ?? this.id;
     this.groupId     = channel?.groupId ?? this.groupId;
     this.thumbnail   = channel?.thumbnail ?? this.thumbnail;
     this.name        = channel?.name ?? this.name;
     this.topic       = channel?.topic ?? this.topic;
     this.memberCount = channel?.memberCount ?? this.memberCount;
     this.isMute      = channel?.isMute ?? this.isMute;
     this.live        = channel?.live ?? this.live;
     this.lastMessage = channel?.lastMessage == null
         ? this.lastMessage
         : ChannelMessageView.fromChannelMessageLite(channel.lastMessage);
 }
Beispiel #3
0
 public void updateFromChannel(Channel channel)
 {
     this.atAll       = this.atAll || (channel?.lastMessage?.mentionEveryone ?? false);
     this.id          = channel?.id ?? this.id;
     this.groupId     = channel?.groupId ?? this.groupId;
     this.thumbnail   = channel?.thumbnail ?? this.thumbnail;
     this.name        = channel?.name ?? this.name;
     this.topic       = channel?.topic ?? this.topic;
     this.memberCount = channel?.memberCount ?? this.memberCount;
     this.isMute      = channel?.isMute ?? this.isMute;
     this.live        = channel?.live ?? this.live;
     this.lastMessage = channel?.lastMessage == null
         ? this.lastMessage
         : ChannelMessageView.fromChannelMessage(channel.lastMessage);
     this.lastMessageId = channel?.lastMessage?.id ?? this.lastMessageId;
 }
Beispiel #4
0
 public static ChannelView fromChannel(Channel channel)
 {
     return(new ChannelView {
         atAll = channel?.lastMessage?.mentionEveryone ?? false,
         memberIds = new List <string>(),
         membersDict = new Dictionary <string, ChannelMember>(),
         id = channel?.id,
         groupId = channel?.groupId,
         thumbnail = channel?.thumbnail ?? "",
         name = channel?.name ?? "",
         topic = channel?.topic,
         memberCount = channel?.memberCount ?? 0,
         isMute = channel?.isMute ?? false,
         live = channel?.live ?? false,
         lastMessageId = channel?.lastMessage?.id,
         lastMessage = ChannelMessageView.fromChannelMessage(channel?.lastMessage),
         messageIds = new List <string>(),
         localMessageIds = new List <string>(),
         oldMessageIds = new List <string>(),
         newMessageIds = new List <string>(),
         currentMember = new ChannelMember()
     });
 }