< Summary

Class:ChatController
Assembly:ChatController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ChatController/ChatController.cs
Covered lines:23
Uncovered lines:157
Coverable lines:180
Total lines:501
Line coverage:12.7% (23 of 180)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ChatController()0%110100%
Awake()0%110100%
InitializeChat(...)0%20400%
AddMessageToChatWindow(...)0%2100%
AddChatMessages(...)0%12300%
UpdateTotalUnseenMessages(...)0%6200%
UpdateUserUnseenMessages(...)0%6200%
UpdateTotalUnseenMessagesByUser(...)0%12300%
UpdateTotalUnseenMessagesByChannel(...)0%6200%
UpdateChannelMembers(...)0%6200%
UpdateChannelInfo(...)0%72800%
JoinChannelConfirmation(...)0%30500%
JoinChannelError(...)0%6200%
LeaveChannelError(...)0%6200%
MuteChannelError(...)0%6200%
UpdateChannelSearchResults(...)0%20400%
JoinOrCreateChannel(...)0%2100%
LeaveChannel(...)0%2100%
GetChannelMessages(...)0%2100%
GetJoinedChannels(...)0%2100%
GetChannelsByName(...)0%2100%
GetChannels(...)0%110100%
MuteChannel(...)0%6200%
UnmuteChannel(...)0%6200%
GetAllocatedChannel(...)0%220100%
GetAllocatedChannelByName(...)0%2100%
GetPrivateMessages(...)0%2100%
MarkChannelMessagesAsSeen(...)0%330100%
GetAllocatedEntries()0%110100%
GetUnseenMessagesByUser()0%2100%
GetUnseenMessagesByChannel()0%2100%
GetAllocatedUnseenMessages(...)0%220100%
GetAllocatedUnseenChannelMessages(...)0%330100%
CreateChannel(...)0%2100%
GetPrivateAllocatedEntriesByUser(...)0%2100%
GetChannelInfo(...)0%2100%
GetChannelMembers(...)0%2100%
GetChannelMembers(...)0%2100%
Send(...)0%2100%
MarkMessagesAsSeen(...)0%110100%
SendChannelWelcomeMessage(...)0%2100%
AddMessage(...)0%56700%
UpdateTotalUnseenMessagesByChannel(...)0%3.073080%
FakePublicMessage()0%6200%
FakePrivateMessage()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ChatController/ChatController.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using DCL.Chat.Channels;
 5using DCL.Chat.WebApi;
 6using DCL.Interface;
 7using JetBrains.Annotations;
 8using UnityEngine;
 9using Random = UnityEngine.Random;
 10
 11public class ChatController : MonoBehaviour, IChatController
 12{
 13    private const string NEARBY_CHANNEL_DESCRIPTION = "Talk to the people around you. If you move far away from someone 
 14    private const string NEARBY_CHANNEL_ID = "nearby";
 15
 016    public static ChatController i { get; private set; }
 17
 218    private readonly Dictionary<string, int> unseenMessagesByUser = new Dictionary<string, int>();
 219    private readonly Dictionary<string, int> unseenMessagesByChannel = new Dictionary<string, int>();
 220    private readonly Dictionary<string, Channel> channels = new Dictionary<string, Channel>();
 221    private readonly List<ChatMessage> messages = new List<ChatMessage>();
 22    private bool chatAlreadyInitialized;
 23    private int totalUnseenMessages;
 24
 25    public event Action<Channel> OnChannelUpdated;
 26    public event Action<Channel> OnChannelJoined;
 27    public event Action<string, ChannelErrorCode> OnJoinChannelError;
 28    public event Action<string> OnChannelLeft;
 29    public event Action<string, ChannelErrorCode> OnChannelLeaveError;
 30    public event Action<string, ChannelErrorCode> OnMuteChannelError;
 31    public event Action OnInitialized;
 32    public event Action<ChatMessage> OnAddMessage;
 33    public event Action<int> OnTotalUnseenMessagesUpdated;
 34    public event Action<string, int> OnUserUnseenMessagesUpdated;
 35    public event Action<string, ChannelMember[]> OnUpdateChannelMembers;
 36    public event Action<string, Channel[]> OnChannelSearchResult;
 37    public event Action<string, int> OnChannelUnseenMessagesUpdated;
 38
 39    // since kernel does not calculate the #nearby channel unseen messages, it is handled on renderer side
 240    public int TotalUnseenMessages => totalUnseenMessages
 41                                      + (unseenMessagesByChannel.ContainsKey(NEARBY_CHANNEL_ID)
 42                                          ? unseenMessagesByChannel[NEARBY_CHANNEL_ID]
 43                                          : 0);
 44
 45    public void Awake()
 46    {
 247        i = this;
 48
 249        channels[NEARBY_CHANNEL_ID] = new Channel(NEARBY_CHANNEL_ID, NEARBY_CHANNEL_ID, 0, 0, true, false,
 50            NEARBY_CHANNEL_DESCRIPTION);
 251    }
 52
 53    // called by kernel
 54    [PublicAPI]
 55    public void InitializeChat(string json)
 56    {
 057        if (chatAlreadyInitialized)
 058            return;
 59
 060        var msg = JsonUtility.FromJson<InitializeChatPayload>(json);
 61
 062        totalUnseenMessages = msg.totalUnseenMessages;
 063        OnInitialized?.Invoke();
 064        OnTotalUnseenMessagesUpdated?.Invoke(TotalUnseenMessages);
 065        chatAlreadyInitialized = true;
 066    }
 67
 68    // called by kernel
 69    [PublicAPI]
 70    public void AddMessageToChatWindow(string jsonMessage) =>
 071        AddMessage(JsonUtility.FromJson<ChatMessage>(jsonMessage));
 72
 73    // called by kernel
 74    [PublicAPI]
 75    public void AddChatMessages(string jsonMessage)
 76    {
 077        var messages = JsonUtility.FromJson<ChatMessageListPayload>(jsonMessage);
 78
 079        if (messages == null) return;
 80
 081        foreach (var message in messages.messages)
 082            AddMessage(message);
 083    }
 84
 85    // called by kernel
 86    [PublicAPI]
 87    public void UpdateTotalUnseenMessages(string json)
 88    {
 089        var msg = JsonUtility.FromJson<UpdateTotalUnseenMessagesPayload>(json);
 090        totalUnseenMessages = msg.total;
 091        OnTotalUnseenMessagesUpdated?.Invoke(TotalUnseenMessages);
 092    }
 93
 94    // called by kernel
 95    [PublicAPI]
 96    public void UpdateUserUnseenMessages(string json)
 97    {
 098        var msg = JsonUtility.FromJson<UpdateUserUnseenMessagesPayload>(json);
 099        unseenMessagesByUser[msg.userId] = msg.total;
 0100        OnUserUnseenMessagesUpdated?.Invoke(msg.userId, msg.total);
 0101    }
 102
 103    // called by kernel
 104    [PublicAPI]
 105    public void UpdateTotalUnseenMessagesByUser(string json)
 106    {
 0107        var msg = JsonUtility.FromJson<UpdateTotalUnseenMessagesByUserPayload>(json);
 108
 0109        foreach (var unseenMessages in msg.unseenPrivateMessages)
 110        {
 0111            var userId = unseenMessages.userId;
 0112            var count = unseenMessages.count;
 0113            unseenMessagesByUser[userId] = count;
 0114            OnUserUnseenMessagesUpdated?.Invoke(userId, count);
 115        }
 0116    }
 117
 118    // called by kernel
 119    [PublicAPI]
 120    public void UpdateTotalUnseenMessagesByChannel(string json)
 121    {
 0122        var msg = JsonUtility.FromJson<UpdateTotalUnseenMessagesByChannelPayload>(json);
 0123        foreach (var unseenMessages in msg.unseenChannelMessages)
 0124            UpdateTotalUnseenMessagesByChannel(unseenMessages.channelId, unseenMessages.count);
 0125    }
 126
 127    // called by kernel
 128    [PublicAPI]
 129    public void UpdateChannelMembers(string payload)
 130    {
 0131        var msg = JsonUtility.FromJson<UpdateChannelMembersPayload>(payload);
 0132        OnUpdateChannelMembers?.Invoke(msg.channelId, msg.members);
 0133    }
 134
 135    [PublicAPI]
 136    public void UpdateChannelInfo(string payload)
 137    {
 0138        var msg = JsonUtility.FromJson<ChannelInfoPayloads>(payload);
 0139        var anyChannelLeft = false;
 140
 0141        foreach (var channelInfo in msg.channelInfoPayload)
 142        {
 0143            var channelId = channelInfo.channelId;
 0144            var channel = new Channel(channelId, channelInfo.name, channelInfo.unseenMessages, channelInfo.memberCount, 
 0145            var justLeft = !channel.Joined;
 146
 0147            if (channels.ContainsKey(channelId))
 148            {
 0149                justLeft = channels[channelId].Joined && !channel.Joined;
 0150                channels[channelId].CopyFrom(channel);
 0151            }
 152            else
 0153                channels[channelId] = channel;
 154
 0155            if (justLeft)
 156            {
 0157                OnChannelLeft?.Invoke(channelId);
 0158                anyChannelLeft = true;
 159            }
 160
 0161            if (anyChannelLeft)
 162            {
 163                // TODO (responsibility issues): extract to another class
 0164                AudioScriptableObjects.leaveChannel.Play(true);
 165            }
 166
 0167            OnChannelUpdated?.Invoke(channel);
 168        }
 0169    }
 170
 171    // called by kernel
 172    [PublicAPI]
 173    public void JoinChannelConfirmation(string payload)
 174    {
 0175        var msg = JsonUtility.FromJson<ChannelInfoPayloads>(payload);
 176
 0177        if (msg.channelInfoPayload.Length == 0)
 0178            return;
 179
 0180        var channelInfo = msg.channelInfoPayload[0];
 0181        var channel = new Channel(channelInfo.channelId, channelInfo.name, channelInfo.unseenMessages, channelInfo.membe
 0182        var channelId = channel.ChannelId;
 183
 0184        if (channels.ContainsKey(channelId))
 0185            channels[channelId].CopyFrom(channel);
 186        else
 0187            channels[channelId] = channel;
 188
 0189        OnChannelJoined?.Invoke(channel);
 0190        OnChannelUpdated?.Invoke(channel);
 191
 192        // TODO (responsibility issues): extract to another class
 0193        AudioScriptableObjects.joinChannel.Play(true);
 194
 0195        SendChannelWelcomeMessage(channel);
 0196    }
 197
 198    // called by kernel
 199    [PublicAPI]
 200    public void JoinChannelError(string payload)
 201    {
 0202        var msg = JsonUtility.FromJson<JoinChannelErrorPayload>(payload);
 0203        OnJoinChannelError?.Invoke(msg.channelId, (ChannelErrorCode) msg.errorCode);
 0204    }
 205
 206    // called by kernel
 207    [PublicAPI]
 208    public void LeaveChannelError(string payload)
 209    {
 0210        var msg = JsonUtility.FromJson<JoinChannelErrorPayload>(payload);
 0211        OnChannelLeaveError?.Invoke(msg.channelId, (ChannelErrorCode) msg.errorCode);
 0212    }
 213
 214    // called by kernel
 215    [PublicAPI]
 216    public void MuteChannelError(string payload)
 217    {
 0218        var msg = JsonUtility.FromJson<MuteChannelErrorPayload>(payload);
 0219        OnMuteChannelError?.Invoke(msg.channelId, (ChannelErrorCode) msg.errorCode);
 0220    }
 221
 222    // called by kernel
 223    [PublicAPI]
 224    public void UpdateChannelSearchResults(string payload)
 225    {
 0226        var msg = JsonUtility.FromJson<ChannelSearchResultsPayload>(payload);
 0227        var channelsResult = new Channel[msg.channels.Length];
 228
 0229        for (var i = 0; i < msg.channels.Length; i++)
 230        {
 0231            var channelPayload = msg.channels[i];
 0232            var channelId = channelPayload.channelId;
 0233            var channel = new Channel(channelId, channelPayload.name, channelPayload.unseenMessages, channelPayload.memb
 234                channelPayload.joined, channelPayload.muted, channelPayload.description);
 235
 0236            if (channels.ContainsKey(channelId))
 0237                channels[channelId].CopyFrom(channel);
 238            else
 0239                channels[channelId] = channel;
 240
 0241            channelsResult[i] = channel;
 242        }
 243
 0244        OnChannelSearchResult?.Invoke(msg.since, channelsResult);
 0245    }
 246
 0247    public void JoinOrCreateChannel(string channelId) => WebInterface.JoinOrCreateChannel(channelId);
 248
 0249    public void LeaveChannel(string channelId) => WebInterface.LeaveChannel(channelId);
 250
 0251    public void GetChannelMessages(string channelId, int limit, string fromMessageId) => WebInterface.GetChannelMessages
 252
 0253    public void GetJoinedChannels(int limit, int skip) => WebInterface.GetJoinedChannels(limit, skip);
 254
 0255    public void GetChannelsByName(int limit, string name, string paginationToken = null) => WebInterface.GetChannels(lim
 256
 1257    public void GetChannels(int limit, string paginationToken) => WebInterface.GetChannels(limit, paginationToken, strin
 258
 259    public void MuteChannel(string channelId)
 260    {
 0261        if (channelId == NEARBY_CHANNEL_ID)
 262        {
 0263            var channel = GetAllocatedChannel(NEARBY_CHANNEL_ID);
 0264            var payload = new ChannelInfoPayloads
 265            {
 266                channelInfoPayload = new[]
 267                {
 268                    new ChannelInfoPayload
 269                    {
 270                        description = channel.Description,
 271                        joined = channel.Joined,
 272                        channelId = channel.ChannelId,
 273                        muted = true,
 274                        name = channel.Name,
 275                        memberCount = channel.MemberCount,
 276                        unseenMessages = channel.UnseenMessages
 277                    }
 278                }
 279            };
 280
 0281            UpdateChannelInfo(JsonUtility.ToJson(payload));
 0282        }
 283        else
 0284            WebInterface.MuteChannel(channelId, true);
 0285    }
 286
 287    public void UnmuteChannel(string channelId)
 288    {
 0289        if (channelId == NEARBY_CHANNEL_ID)
 290        {
 0291            var channel = GetAllocatedChannel(NEARBY_CHANNEL_ID);
 0292            var payload = new ChannelInfoPayloads
 293            {
 294                channelInfoPayload = new[]
 295                {
 296                    new ChannelInfoPayload
 297                    {
 298                        description = channel.Description,
 299                        joined = channel.Joined,
 300                        channelId = channel.ChannelId,
 301                        muted = false,
 302                        name = channel.Name,
 303                        memberCount = channel.MemberCount,
 304                        unseenMessages = channel.UnseenMessages
 305                    }
 306                }
 307            };
 308
 0309            UpdateChannelInfo(JsonUtility.ToJson(payload));
 0310        }
 311        else
 0312            WebInterface.MuteChannel(channelId, false);
 0313    }
 314
 315    public Channel GetAllocatedChannel(string channelId) =>
 2316        channels.ContainsKey(channelId) ? channels[channelId] : null;
 317
 318    public Channel GetAllocatedChannelByName(string channelName) =>
 0319        channels.Values.FirstOrDefault(x => x.Name == channelName);
 320
 321    public void GetPrivateMessages(string userId, int limit, string fromMessageId) =>
 0322        WebInterface.GetPrivateMessages(userId, limit, fromMessageId);
 323
 324    public void MarkChannelMessagesAsSeen(string channelId)
 325    {
 2326        if (channelId == NEARBY_CHANNEL_ID)
 327        {
 1328            UpdateTotalUnseenMessagesByChannel(NEARBY_CHANNEL_ID, 0);
 1329            OnTotalUnseenMessagesUpdated?.Invoke(TotalUnseenMessages);
 330        }
 331
 2332        WebInterface.MarkChannelMessagesAsSeen(channelId);
 2333    }
 334
 2335    public List<ChatMessage> GetAllocatedEntries() => new List<ChatMessage>(messages);
 336
 0337    public void GetUnseenMessagesByUser() => WebInterface.GetUnseenMessagesByUser();
 338
 0339    public void GetUnseenMessagesByChannel() => WebInterface.GetUnseenMessagesByChannel();
 340
 341    public int GetAllocatedUnseenMessages(string userId) =>
 1342        unseenMessagesByUser.ContainsKey(userId) ? unseenMessagesByUser[userId] : 0;
 343
 344    public int GetAllocatedUnseenChannelMessages(string channelId) =>
 1345        !string.IsNullOrEmpty(channelId)
 346            ? unseenMessagesByChannel.ContainsKey(channelId) ? unseenMessagesByChannel[channelId] : 0
 347            : 0;
 348
 0349    public void CreateChannel(string channelId) => WebInterface.CreateChannel(channelId);
 350
 351    public List<ChatMessage> GetPrivateAllocatedEntriesByUser(string userId)
 352    {
 0353        return messages
 0354            .Where(x => (x.sender == userId || x.recipient == userId) && x.messageType == ChatMessage.Type.PRIVATE)
 355            .ToList();
 356    }
 357
 0358    public void GetChannelInfo(string[] channelIds) => WebInterface.GetChannelInfo(channelIds);
 359
 360    public void GetChannelMembers(string channelId, int limit, int skip, string name) =>
 0361        WebInterface.GetChannelMembers(channelId, limit, skip, name);
 362
 363    public void GetChannelMembers(string channelId, int limit, int skip) =>
 0364        WebInterface.GetChannelMembers(channelId, limit, skip, string.Empty);
 365
 0366    public void Send(ChatMessage message) => WebInterface.SendChatMessage(message);
 367
 1368    public void MarkMessagesAsSeen(string userId) => WebInterface.MarkMessagesAsSeen(userId);
 369
 370    private void SendChannelWelcomeMessage(Channel channel)
 371    {
 0372        var message =
 373            new ChatMessage(ChatMessage.Type.SYSTEM, "", @$"This is the start of the channel #{channel.Name}.\n
 374Invite others to join by quoting the channel name in other chats or include it as a part of your bio.")
 375            {
 376                recipient = channel.ChannelId,
 377                timestamp = 0,
 378                isChannelMessage = true,
 379                messageId = Guid.NewGuid().ToString()
 380            };
 381
 0382        AddMessage(message);
 0383    }
 384
 385    private void AddMessage(ChatMessage message)
 386    {
 0387        if (message == null) return;
 388
 0389        messages.Add(message);
 390
 0391        if (message.messageType == ChatMessage.Type.PUBLIC && string.IsNullOrEmpty(message.recipient))
 392        {
 0393            if (!unseenMessagesByChannel.ContainsKey(NEARBY_CHANNEL_ID))
 0394                unseenMessagesByChannel[NEARBY_CHANNEL_ID] = 0;
 395
 0396            UpdateTotalUnseenMessagesByChannel(NEARBY_CHANNEL_ID, unseenMessagesByChannel[NEARBY_CHANNEL_ID] + 1);
 0397            OnTotalUnseenMessagesUpdated?.Invoke(TotalUnseenMessages);
 398        }
 399
 0400        OnAddMessage?.Invoke(message);
 0401    }
 402
 403    private void UpdateTotalUnseenMessagesByChannel(string channelId, int count)
 404    {
 1405        unseenMessagesByChannel[channelId] = count;
 406
 1407        if (channels.ContainsKey(channelId))
 1408            channels[channelId].UnseenMessages = count;
 409
 1410        OnChannelUnseenMessagesUpdated?.Invoke(channelId, count);
 0411    }
 412
 413    [ContextMenu("Fake Public Message")]
 414    public void FakePublicMessage()
 415    {
 0416        UserProfile ownProfile = UserProfile.GetOwnUserProfile();
 417        const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 0418        var bodyLength = Random.Range(5, 30);
 0419        var bodyText = "";
 0420        for (var i = 0; i < bodyLength; i++)
 0421            bodyText += chars[Random.Range(0, chars.Length)];
 422
 0423        var model = new UserProfileModel
 424        {
 425            userId = "test user 1",
 426            name = "test user 1",
 427        };
 428
 0429        UserProfileController.i.AddUserProfileToCatalog(model);
 430
 0431        var model2 = new UserProfileModel()
 432        {
 433            userId = "test user 2",
 434            name = "test user 2",
 435        };
 436
 0437        UserProfileController.i.AddUserProfileToCatalog(model2);
 438
 0439        var msg = new ChatMessage()
 440        {
 441            body = bodyText,
 442            sender = model.userId,
 443            messageType = ChatMessage.Type.PUBLIC,
 444            timestamp = (ulong) DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
 445        };
 446
 0447        var msg2 = new ChatMessage()
 448        {
 449            body = bodyText,
 450            sender = ownProfile.userId,
 451            messageType = ChatMessage.Type.PUBLIC,
 452            timestamp = (ulong) DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
 453        };
 454
 0455        AddMessageToChatWindow(JsonUtility.ToJson(msg));
 0456        AddMessageToChatWindow(JsonUtility.ToJson(msg2));
 0457    }
 458
 459    [ContextMenu("Fake Private Message")]
 460    public void FakePrivateMessage()
 461    {
 0462        UserProfile ownProfile = UserProfile.GetOwnUserProfile();
 463
 0464        var model = new UserProfileModel()
 465        {
 466            userId = "test user 1",
 467            name = "test user 1",
 468        };
 469
 0470        UserProfileController.i.AddUserProfileToCatalog(model);
 471
 0472        var model2 = new UserProfileModel()
 473        {
 474            userId = "test user 2",
 475            name = "test user 2",
 476        };
 477
 0478        UserProfileController.i.AddUserProfileToCatalog(model2);
 479
 0480        var msg = new ChatMessage()
 481        {
 482            body = "test message",
 483            sender = model.userId,
 484            recipient = ownProfile.userId,
 485            messageType = ChatMessage.Type.PRIVATE,
 486            timestamp = (ulong) DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
 487        };
 488
 0489        var msg2 = new ChatMessage()
 490        {
 491            body = "test message 2",
 492            recipient = model2.userId,
 493            sender = ownProfile.userId,
 494            messageType = ChatMessage.Type.PRIVATE,
 495            timestamp = (ulong) DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
 496        };
 497
 0498        AddMessageToChatWindow(JsonUtility.ToJson(msg));
 0499        AddMessageToChatWindow(JsonUtility.ToJson(msg2));
 0500    }
 501}

Methods/Properties

i()
i(ChatController)
ChatController()
TotalUnseenMessages()
Awake()
InitializeChat(System.String)
AddMessageToChatWindow(System.String)
AddChatMessages(System.String)
UpdateTotalUnseenMessages(System.String)
UpdateUserUnseenMessages(System.String)
UpdateTotalUnseenMessagesByUser(System.String)
UpdateTotalUnseenMessagesByChannel(System.String)
UpdateChannelMembers(System.String)
UpdateChannelInfo(System.String)
JoinChannelConfirmation(System.String)
JoinChannelError(System.String)
LeaveChannelError(System.String)
MuteChannelError(System.String)
UpdateChannelSearchResults(System.String)
JoinOrCreateChannel(System.String)
LeaveChannel(System.String)
GetChannelMessages(System.String, System.Int32, System.String)
GetJoinedChannels(System.Int32, System.Int32)
GetChannelsByName(System.Int32, System.String, System.String)
GetChannels(System.Int32, System.String)
MuteChannel(System.String)
UnmuteChannel(System.String)
GetAllocatedChannel(System.String)
GetAllocatedChannelByName(System.String)
GetPrivateMessages(System.String, System.Int32, System.String)
MarkChannelMessagesAsSeen(System.String)
GetAllocatedEntries()
GetUnseenMessagesByUser()
GetUnseenMessagesByChannel()
GetAllocatedUnseenMessages(System.String)
GetAllocatedUnseenChannelMessages(System.String)
CreateChannel(System.String)
GetPrivateAllocatedEntriesByUser(System.String)
GetChannelInfo(System.String[])
GetChannelMembers(System.String, System.Int32, System.Int32, System.String)
GetChannelMembers(System.String, System.Int32, System.Int32)
Send(DCL.Interface.ChatMessage)
MarkMessagesAsSeen(System.String)
SendChannelWelcomeMessage(DCL.Chat.Channels.Channel)
AddMessage(DCL.Interface.ChatMessage)
UpdateTotalUnseenMessagesByChannel(System.String, System.Int32)
FakePublicMessage()
FakePrivateMessage()