private void SendButton_Click(object sender, EventArgs e) { if (OutgoingTextBox.TextLength > 0) { RichTextBox1.SelectionColor = Color.Blue; RichTextBox1.AppendText(string.Format("({0}) Me: ", DateTime.Now.ToString("hh:mm:ss"))); RichTextBox1.SelectionColor = Color.Black; RichTextBox1.AppendText(string.Format("{0}\n", OutgoingTextBox.Text)); XmppGlobal.Messaging.SendMessage(foreign_jid, OutgoingTextBox.Text, message_type, thread_id); OutgoingTextBox.Text = string.Empty; XmppSounds.PlaySound(DefaultSounds.MessageIn); } }
public void GotMessage(jabber.protocol.client.Message msg) { foreign_jid = msg.From; message_type = msg.Type; thread_id = msg.Thread; if (msg.Body.Trim().Length > 0) { RichTextBox1.SelectionColor = Color.Red; RichTextBox1.AppendText(string.Format("({0}) {1}: ", DateTime.Now.ToString("hh:mm:ss"), Text)); RichTextBox1.SelectionColor = Color.Black; RichTextBox1.AppendText(string.Format("{0}\n", msg.Body)); XmppSounds.PlaySound(DefaultSounds.MessageIn); } }