Пример #1
0
 private void BufferMsg(Dictionary<string, dynamic> dict, bool isMe = false)
 {
     Connection con = Connections[(int)dict["cid"]];
     ChatBuffer buf = con.Buffers[(int)dict["bid"]];
     var m = new Message { BufferId = (int)dict["bid"], ChannelName = dict["chan"], Eid = (long)dict["eid"], Text = dict["msg"], From = dict["from"] };
     buf.AddMessage(m, isMe);
 }
Пример #2
0
 internal void AddMessage(Message m, bool isMe = false)
 {
     _messages.Add(m);
     _dispatcher.Invoke(() => Messages.Add(m));
     if (messageAdded != null && !isMe)
         messageAdded(this, new MessageEventArgs {Message = m});
     else if (messageMeAdded != null && isMe)
         messageMeAdded(this, new MessageEventArgs {Message = m});
     // Console.WriteLine("Message added to " + name);
 }