예제 #1
0
 void client_GroupChat(object sender, GroupChatEventArgs e)
 {
     if (e.Group == this)
     {
         Chatted.SafeInvoke(this, e);
     }
 }
        void client_GroupChat(object sender, GroupChatEventArgs e)
        {
            var _e = new ChatReceivedEventArgs(new ChatMessage(e.User, e.Font, e.Body, e.Timestamp));

            if (!conversationEventsMap.ContainsKey(e.Group.Name))
            {
                CreateConversation(e.Group, false);
            }

            conversationEventsMap[e.Group.Name].RaiseChatReceived(_e);
        }
        void client_GroupChat(object sender, GroupChatEventArgs e)
        {
            var _e = new ChatReceivedEventArgs(new ChatMessage(e.User, e.Font, e.Body, e.Timestamp));

            if (!conversationEventsMap.ContainsKey(e.Group.Name))
            {
                CreateConversation(e.Group, false);
            }

            conversationEventsMap[e.Group.Name].RaiseChatReceived(_e);
        }
예제 #4
0
        void HandleChatGroup(JObject message)
        {
            var   username  = Convert.ToString(message["from"]);
            var   user      = GetUser(username);
            var   groupname = Convert.ToString(message["via"]);
            Group group;

            if (!groups.TryGetValue(groupname, out group))
            {
                log.Warn("Got a chat message from a group we don't know about.");
                return;
            }

            var args = new GroupChatEventArgs(
                group,
                user,
                ParseFont(message["font"]),
                new UTF8Encoding(false, true).GetString(Convert.FromBase64String(Convert.ToString(message["body"]))),
                DateTime.Parse(message["timestamp"].ToString(), null, System.Globalization.DateTimeStyles.RoundtripKind)
                );

            GroupChat.SafeInvoke(this, args);
        }
예제 #5
0
 void client_GroupChat(object sender, GroupChatEventArgs e)
 {
     if (e.Group == this)
         Chatted.SafeInvoke(this, e);
 }
예제 #6
0
        void HandleChatGroup(JObject message)
        {
            var username = Convert.ToString(message["from"]);
            var user = GetUser(username);
            var groupname = Convert.ToString(message["via"]);
            Group group;
            if (!groups.TryGetValue(groupname, out group))
            {
                log.Warn("Got a chat message from a group we don't know about.");
                return;
            }

            var args = new GroupChatEventArgs(
                group,
                user,
                ParseFont(message["font"]),
                new UTF8Encoding(false, true).GetString(Convert.FromBase64String(Convert.ToString(message["body"]))),
                DateTime.Parse(message["timestamp"].ToString(), null, System.Globalization.DateTimeStyles.RoundtripKind)
                );
            GroupChat.SafeInvoke(this, args);
        }