/// <summary> /// Join a chatroom /// </summary> /// <param name="room">jid of the room to join</param> /// <param name="nickname">nickname to use in the room</param> /// <param name="password">password for password protected chat rooms</param> /// <param name="disableHistory">true for joining without chat room history</param> public void JoinRoom(Jid room, string nickname, string password, bool disableHistory) { /* <presence from='[email protected]/pda' to='[email protected]/thirdwitch'> <x xmlns='http://jabber.org/protocol/muc'> <password>cauldron</password> </x> </presence> join room and request no history <presence from='[email protected]/pda' to='[email protected]/thirdwitch'> <x xmlns='http://jabber.org/protocol/muc'> <history maxchars='0'/> </x> </presence> */ Jid to = new Jid(room.ToString()); to.Resource = nickname; Presence pres = new Presence(); pres.To = to; Muc x = new Muc(); if (password != null) x.Password = password; if (disableHistory) { History hist = new History(); hist.MaxCharacters = 0; x.History = hist; } pres.AddChild(x); m_connection.Send(pres); }
/// <summary> /// Sends our Presence, the packet is built of Status, Show and Priority /// </summary> public void SendMyPresence() { Presence pres = new Presence(m_Show, m_Status, m_Priority); // Add client caps when enabled if (m_EnableCapabilities) { if (m_Capabilities.Version == null) UpdateCapsVersion(); pres.AddChild(m_Capabilities); } this.Send(pres); }