public void ReceiveChatMessage(SendMessageReply reply) { LogMsg(reply.Words); Invoke((Action)(() => { if (reply.FromSystem) { if (reply.Words.ToLower().Contains("left")) { if (m_UserList.Contains(reply.UserName)) { m_UserList.Remove(reply.UserName); UpdateUserList(); string target = cbbChatToWho.SelectedIndex > 0 ? cbbChatToWho.Items[cbbChatToWho.SelectedIndex].ToString() : ""; if (target == reply.UserName && cbbChatToWho.Items.Count > 0) { cbbChatToWho.SelectedIndex = 0; } } } else if (reply.Words.ToLower().Contains("entered")) { if (!m_UserList.Contains(reply.UserName)) { m_UserList.Add(reply.UserName); UpdateUserList(); } } ShowText("SYSTEM: " + reply.Words); } else { string line = reply.UserName; if (reply.Target != null && reply.Target.Length > 0) { line += " to " + reply.Target; } if (reply.IsPrivate) { line += " (in private)"; } line += " : " + reply.Words; ShowText(line); } })); }
public void ReceiveChatMessage(SendMessageReply reply) { LogMsg(reply.Words); Invoke((Action)(() => { if (reply.FromSystem) { if (reply.Words.ToLower().Contains("left")) { if (m_UserList.Contains(reply.UserName)) { m_UserList.Remove(reply.UserName); UpdateUserList(); string target = cbbChatToWho.SelectedIndex > 0 ? cbbChatToWho.Items[cbbChatToWho.SelectedIndex].ToString() : ""; if (target == reply.UserName && cbbChatToWho.Items.Count > 0) cbbChatToWho.SelectedIndex = 0; } } else if (reply.Words.ToLower().Contains("entered")) { if (!m_UserList.Contains(reply.UserName)) { m_UserList.Add(reply.UserName); UpdateUserList(); } } ShowText("SYSTEM: " + reply.Words); } else { string line = reply.UserName; if (reply.Target != null && reply.Target.Length > 0) line += " to " + reply.Target; if (reply.IsPrivate) line += " (in private)"; line += " : " + reply.Words; ShowText(line); } })); }