コード例 #1
0
 void OnChatMessage(byte[] data)
 {
     SerializationHelper.Deserialize <Squiggle.Core.Chat.Transport.Message>(data, msg =>
     {
         var args = new ChatMessageReceivedEventArgs()
         {
             Message = msg
         };
         ChatMessageReceived(this, args);
     }, "chat message");
 }
コード例 #2
0
ファイル: SquiggleBridge.cs プロジェクト: dugu01/squiggle
        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);
        }