Example #1
0
		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;
		}
Example #2
0
		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();
		}
Example #3
0
		private void appendMessage(MessageStanza s)
		{
			textBox.Text += "["+DateTime.Now.ToShortTimeString()+"] <"+receiverJid+"> : "+ s.FirstBody.Body + "\r\n";
		}
Example #4
0
		public void NewMessage(MessageStanza s)
		{	
			appendMessage(s);
		}