private void ReceiveMessageHistory(JToken jsonMessage) { MessageReception message = jsonMessage.ToObject <MessageReception>(); bool isSentByMe = message.username == ServerService.instance.username; App.Current.Dispatcher.Invoke(delegate { Messages.Add(new MessageChat(message.username, message.content, isSentByMe, message.time)); }); }
private void ReceiveMessage(JToken jsonMessage) { MessageReception message = jsonMessage.ToObject <MessageReception>(); if (message.channel_id == this.ID || IsLobbyChat) { bool isSentByMe = message.username == ServerService.instance.username; App.Current.Dispatcher.Invoke(delegate { Messages.Add(new MessageChat(message.username, message.content, isSentByMe, message.time)); }); } }