void OnChatMessage(byte[] data) { SerializationHelper.Deserialize <Squiggle.Core.Chat.Transport.Message>(data, msg => { var args = new ChatMessageReceivedEventArgs() { Message = msg }; ChatMessageReceived(this, args); }, "chat message"); }
void bridgeHost_ChatMessageReceived(object sender, ChatMessageReceivedEventArgs e) { if (e.Message is IMessageHasParticipants) { var msg = (IMessageHasParticipants)e.Message; msg.Participants = ConvertChatEndPointsForRecipient(msg.Participants, e.Message.Recipient).ToList(); } RouteChatMessageToLocalOrRemoteUser((local, target, newSender, newRecipient) => { e.Message.Sender = newSender; e.Message.Recipient = newRecipient; bridgeHost.SendChatMessage(local, target, e.Message); }, e.Message.Sender, e.Message.Recipient); }