public static Stanza GetStanza(XmlNode xml) { Stanza s = null; switch(xml.Name) { case "iq": s = new IQStanza(xml); break; case "message": s = new MessageStanza(xml); break; case "presence": s = new PresenceStanza(xml); break; default: s = new Stanza(xml); break; } return s; }
private void onMessageStanzaReceived(MessageStanza s) { // Get or create a chat window and show the message MessageForm msgf = null; if(chats[s.From] != null) { msgf = (MessageForm)chats[s.From]; } else { msgf = new MessageForm(this.session, "Title", s.From, s.Language, s.ThreadID); chats[s.From] = msgf; } msgf.NewMessage(s); msgf.Show(); }
private void appendMessage(MessageStanza s) { textBox.Text += "["+DateTime.Now.ToShortTimeString()+"] <"+receiverJid+"> : "+ s.FirstBody.Body + "\r\n"; }
public void NewMessage(MessageStanza s) { appendMessage(s); }