#include <mucroom.h>
Inherits DiscoHandler, PresenceHandler, IqHandler, MessageHandler, and DiscoNodeHandler.
Inherited by InstantMUCRoom.
Inheritance diagram for MUCRoom:


Public Types | |
| enum | HistoryRequestType { HistoryUnknown, HistoryMaxChars, HistoryMaxStanzas, HistorySeconds, HistorySince } |
Public Member Functions | |
| MUCRoom (ClientBase *parent, const JID &nick, MUCRoomHandler *mrh, MUCRoomConfigHandler *mrch=0) | |
| virtual | ~MUCRoom () |
| void | setPassword (const std::string &password) |
| const std::string | name () const |
| const std::string | service () const |
| const std::string | nick () const |
| virtual void | join () |
| void | leave (const std::string &msg="") |
| void | send (const std::string &message) |
| void | setSubject (const std::string &subject) |
| MUCRoomAffiliation | affiliation () const |
| MUCRoomRole | role () const |
| void | setNick (const std::string &nick) |
| void | setPresence (Presence presence, const std::string &msg="") |
| void | invite (const JID &invitee, const std::string &reason, bool cont=false) |
| void | getRoomInfo () |
| void | getRoomItems () |
| void | setPublish (bool publish, bool publishNick) |
| void | registerMUCRoomHandler (MUCRoomHandler *mrl) |
| void | removeMUCRoomHandler () |
| void | registerMUCRoomConfigHandler (MUCRoomConfigHandler *mrch) |
| void | removeMUCRoomConfigHandler () |
| void | addHistory (const std::string &message, const JID &from, const std::string &stamp) |
| void | setRequestHistory (int value, HistoryRequestType type) |
| void | setRequestHistory (const std::string &since) |
| void | requestVoice () |
| void | kick (const std::string &nick, const std::string &reason="") |
| void | ban (const std::string &nick, const std::string &reason) |
| void | grantVoice (const std::string &nick, const std::string &reason) |
| void | revokeVoice (const std::string &nick, const std::string &reason) |
| void | setRole (const std::string &nick, MUCRoomRole role, const std::string &reason="") |
| void | setAffiliation (const std::string &nick, MUCRoomAffiliation affiliation, const std::string &reason) |
| void | requestRoomConfig () |
| void | acknowledgeInstantRoom () |
| void | cancelRoomCreation () |
| void | destroy (const std::string &reason="", const JID *alternate=0, const std::string &password="") |
| void | requestList (MUCOperation operation) |
| void | storeList (const MUCListItemList items, MUCOperation operation) |
| int | flags () const |
| virtual void | handleDiscoInfoResult (Stanza *stanza, int context) |
| virtual void | handleDiscoItemsResult (Stanza *stanza, int context) |
| virtual void | handleDiscoError (Stanza *stanza, int context) |
| virtual void | handlePresence (Stanza *stanza) |
| virtual void | handleMessage (Stanza *stanza, MessageSession *session=0) |
| virtual bool | handleIq (Stanza *) |
| virtual bool | handleIqID (Stanza *stanza, int context) |
| virtual StringList | handleDiscoNodeFeatures (const std::string &node) |
| virtual StringMap | handleDiscoNodeIdentities (const std::string &node, std::string &name) |
| virtual DiscoNodeItemList | handleDiscoNodeItems (const std::string &node="") |
Static Public Member Functions | |
| static Stanza * | declineInvitation (const JID &room, const JID &invitor, const std::string &reason="") |
| static Stanza * | createDataForm (const JID &room, const DataForm &df) |
Usage is pretty simple:
Derrive an object from MUCRoomHandler and implement its virtuals:
class MyClass : public MUCRoomHandler { ... };
Then create a new MUCRoom object and pass it a valid ClientBase, the desired full room JID, your MUCRoomHandler-derived object, and an optional MUCRoomConfigHandler-derived object.
void MyOtherClass::joinRoom( const std::string& room, const std::string& service, const std::string& nick ) { MyClass *myHandler = new MyClass(...); JID roomJID( room + "@" + service + "/" + nick ); m_room = new MUCRoom( m_clientbase, roomJID, myHandler, 0 ); m_room->join(); }
When joining the room was successful, the various MUCRoomHandler functions will start to be called. If joining was not successful, MUCRoomHandler::handleMUCError() will be called, giving a hint at the reason for the failure.
To set up your own room, or to configure an existing room, you should also derive a class from MUCRoomConfigHandler and register it with the MUCRoom (either by using it with MUCRoom's constructor, or by calling registerMUCRoomConfigHandler()).
To quickly create an instant room, see InstantMUCRoom.
To quickly create an instant room to turn a one-to-one chat into a multi-user chat, see UniqueMUCRoom.
To send a private message to a room participant, use gloox::MessageSession with the participant's full room JID (room@service/nick).
XEP version: 1.21
Definition at line 83 of file mucroom.h.
|
|
Allowable history request types. To disable sending of history, use any value except HistoryUnknown and specify a zero-length time span (using setRequestHistory()).
|
|
||||||||||||||||||||
|
Creates a new abstraction of a Multi-User Chat room. The room is not joined automatically. Use join() to join the room, use leave() to leave it.
Definition at line 25 of file mucroom.cpp. |
|
|
Virtual Destructor. Definition at line 35 of file mucroom.cpp. |
|
|
Use this function to accept the room's default configuration. This function is useful only after MUCRoomHandler::handleMUCRoomCreation() was called. This is a NOOP at any other time. Definition at line 652 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to add history to a (newly created) room. The use case from the MUC spec is to add history to a room that was created in the process of a transformation of a one-to-one chat to a multi-user chat.
Definition at line 248 of file mucroom.cpp. |
|
|
Returns the user's current affiliation with this room.
|
|
||||||||||||
|
Use this function to ban a user from the room. Depending on service and/or room configuration and role/affiliation this may not always succeed. Usually, an affiliation of admin is necessary.
Definition at line 326 of file mucroom.cpp. |
|
|
Use this function to cancel the creation of a room. This function is useful only after MUCRoomHandler::handleMUCRoomCreation() was called. This is a NOOP at any other time. Definition at line 671 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to create a Tag that approves a voice request or registration request delivered via MUCRoomConfigHandler::handleMUCVoiceRequest(). You will need to send this Tag off manually using Client/ClientBase.
Definition at line 279 of file mucroom.cpp. |
|
||||||||||||||||
|
This static function allows to formally decline a MUC invitation received via the MUCInvitationListener.
Definition at line 220 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to destroy the room. All the occupants will be removed from the room.
Definition at line 124 of file mucroom.cpp. |
|
|
Returns the currently know room flags.
|
|
|
Use this function to request basic room info, possibly prior to joining it. Results are announced using the MUCRoomHandler. Definition at line 174 of file mucroom.cpp. |
|
|
Use this function to request information about the current room occupants, possibly prior to joining it. The room ay be configured not to disclose such information. Results are announced using the MUCRoomHandler. Definition at line 183 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to grant voice to a user in a moderated room. Depending on service and/or room configuration and role/affiliation this may not always succeed. Usually, a role of 'moderator' is necessary.
Definition at line 316 of file mucroom.cpp. |
|
||||||||||||
|
Reimplement this function to receive disco error notifications.
Implements DiscoHandler. Definition at line 1048 of file mucroom.cpp. |
|
||||||||||||
|
Reimplement this function if you want to be notified about the result of an disco#info query.
Implements DiscoHandler. Definition at line 949 of file mucroom.cpp. |
|
||||||||||||
|
Reimplement this function if you want to be notified about the result of an disco#items query.
Implements DiscoHandler. Definition at line 1017 of file mucroom.cpp. |
|
|
In addition to
Implements DiscoNodeHandler. Definition at line 1069 of file mucroom.cpp. |
|
||||||||||||
|
In addition to
Implements DiscoNodeHandler. Definition at line 1074 of file mucroom.cpp. |
|
|
This function is used to gather more information on a specific node. It is called when a disco#items query arrives with a node attribute that matches the one registered for this handler. If node is empty, items for the root node (no node) shall be returned.
Implements DiscoNodeHandler. Definition at line 1079 of file mucroom.cpp. |
|
|
Reimplement this function if you want to be notified about incoming IQs.
Implements IqHandler. |
|
||||||||||||
|
Reimplement this function if you want to be notified about incoming IQs with a specific value of the
Implements IqHandler. Definition at line 816 of file mucroom.cpp. |
|
||||||||||||
|
Reimplement this function if you want to be notified about incoming messages.
Implements MessageHandler. Definition at line 727 of file mucroom.cpp. |
|
|
Reimplement this function if you want to be updated on incoming presence notifications.
Implements PresenceHandler. Definition at line 516 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to invite another user to this room.
Definition at line 201 of file mucroom.cpp. |
|
|
Join this room. Reimplemented in UniqueMUCRoom. Definition at line 49 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to kick a user from the room. Depending on service and/or room configuration and role/affiliation this may not always succeed. Usually, a role of 'moderator' is necessary.
Definition at line 311 of file mucroom.cpp. |
|
|
Leave this room.
Definition at line 103 of file mucroom.cpp. |
|
|
A convenience function that returns the room's name.
|
|
|
A convenience function that returns the user's nickname in the room.
|
|
|
Use this function to register a (new) MUCRoomConfigHandler with this room. There can be only one MUCRoomConfigHandler per room at any one time.
|
|
|
Use this function to register a (new) MUCRoomHandler with this room. There can be only one MUCRoomHandler per room at any one time.
|
|
|
Use this function to remove the registered MUCRoomConfigHandler. |
|
|
Use this function to remove the registered MUCRoomHandler. |
|
|
Use this function to request a particluar list of room occupants.
Definition at line 412 of file mucroom.cpp. |
|
|
Use this function to request the room's configuration form. It can be used either after MUCRoomHandler::handleMUCRoomCreation() was called, or at any later time. Usually owner privileges are required for this action to succeed. Definition at line 690 of file mucroom.cpp. |
|
|
It is not possible for a visitor to speak in a moderated room. Use this function to request voice from the moderator. Definition at line 288 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to revoke voice from a user in a moderated room. Depending on service and/or room configuration and role/affiliation this may not always succeed. Usually, a role of 'moderator' is necessary.
Definition at line 321 of file mucroom.cpp. |
|
|
Returns the user's current role in this room.
|
|
|
Sends a chat message to the room.
Definition at line 148 of file mucroom.cpp. |
|
|
A convenience function that returns the name/address of the MUC service the room is running on (e.g., conference.jabber.org).
|
|
||||||||||||||||
|
Use this function to change the affiliation of a user in the room. Usually, at least admin privileges are required to succeed.
Definition at line 336 of file mucroom.cpp. |
|
|
Use this function to change the user's nickname in the room. The MUC service may decline the request to set a new nickname. You should not assume the nick change was successful until it is acknowledged via the MUCRoomHandler.
Definition at line 160 of file mucroom.cpp. |
|
|
Use this function to set a password to use when joining a (password protected) room.
|
|
||||||||||||
|
Use this function to set the user's presence in this room. It is not possible to use PresenceUnavailable with this function.
Definition at line 192 of file mucroom.cpp. |
|
||||||||||||
|
The MUC spec enables other entities to discover via Service Discovery which rooms an entity is in. By default, gloox does not publish such info for privacy reasons. This function can be used to enable publishing the info for this room.
Definition at line 234 of file mucroom.cpp. |
|
|
Use this function to request room history since specific datetime. History is sent only once after entering a room. You should use this function before joining.
Definition at line 272 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to request room history. Set
Definition at line 265 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to change the role of a user in the room. Usually, at least moderator privileges are required to succeed.
Definition at line 331 of file mucroom.cpp. |
|
|
Sets the subject of the room to the given string. The MUC service may decline the request to set a new subject. You should not assume the subject was set successfully util it is acknowledged via the MUCRoomHandler.
Definition at line 154 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to store a (modified) list for the room.
Definition at line 453 of file mucroom.cpp. |
1.4.1