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

Public Types | |
| enum | HistoryRequestType { HistoryMaxChars, HistoryMaxStanzas, HistorySeconds, HistorySince, HistoryUnknown } |
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=EmptyString) |
| 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::PresenceType presence, const std::string &msg=EmptyString) |
| void | invite (const JID &invitee, const std::string &reason, const std::string &thread=EmptyString) |
| 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=EmptyString) |
| 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=EmptyString) |
| void | setAffiliation (const std::string &nick, MUCRoomAffiliation affiliation, const std::string &reason) |
| void | requestRoomConfig () |
| void | acknowledgeInstantRoom () |
| void | cancelRoomCreation () |
| void | destroy (const std::string &reason=EmptyString, const JID &alternate=JID(), const std::string &password=EmptyString) |
| void | requestList (MUCOperation operation) |
| void | storeList (const MUCListItemList items, MUCOperation operation) |
| int | flags () const |
| virtual void | handleDiscoInfo (const JID &from, const Disco::Info &info, int context) |
| virtual void | handleDiscoItems (const JID &from, const Disco::Items &items, int context) |
| virtual void | handleDiscoError (const JID &from, const Error *error, int context) |
| virtual void | handlePresence (const Presence &presence) |
| virtual void | handleMessage (const Message &msg, MessageSession *session=0) |
| virtual bool | handleIq (const IQ &iq) |
| virtual void | handleIqID (const IQ &iq, int context) |
| virtual StringList | handleDiscoNodeFeatures (const JID &from, const std::string &node) |
| virtual Disco::IdentityList | handleDiscoNodeIdentities (const JID &from, const std::string &node) |
| virtual Disco::ItemList | handleDiscoNodeItems (const JID &from, const std::string &node=EmptyString) |
Static Public Member Functions | |
| static Message * | declineInvitation (const JID &room, const JID &invitor, const std::string &reason=EmptyString) |
| static Message * | 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 85 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 527 of file mucroom.cpp. |
|
|
Virtual Destructor. Definition at line 544 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. |
|
||||||||||||||||
|
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 681 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.
|
|
|
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. |
|
||||||||||||
|
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 705 of file mucroom.cpp. |
|
||||||||||||||||
|
This static function allows to formally decline a MUC invitation received via the MUCInvitationListener.
Definition at line 660 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to destroy the room. All the occupants will be removed from the room.
Definition at line 593 of file mucroom.cpp. |
|
|
Returns the currently known room flags.
|
|
|
Use this function to request basic room info, possibly prior to joining it. Results are announced using the MUCRoomHandler. Definition at line 629 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 635 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.
|
|
||||||||||||||||
|
Reimplement this function to receive disco error notifications.
Implements DiscoHandler. Definition at line 1175 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 1101 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 1158 of file mucroom.cpp. |
|
||||||||||||
|
In addition to
Implements DiscoNodeHandler. Definition at line 1193 of file mucroom.cpp. |
|
||||||||||||
|
In addition to
Implements DiscoNodeHandler. Definition at line 1198 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 1204 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 997 of file mucroom.cpp. |
|
||||||||||||
|
Reimplement this function if you want to be notified about incoming messages.
Implements MessageHandler. Definition at line 929 of file mucroom.cpp. |
|
|
Reimplement this function if you want to be updated on incoming presence notifications.
Implements PresenceHandler. Definition at line 811 of file mucroom.cpp. |
|
||||||||||||||||
|
Use this function to invite another user to this room.
Definition at line 650 of file mucroom.cpp. |
|
|
Join this room. Reimplemented in UniqueMUCRoom. Definition at line 560 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.
|
|
|
Leave this room.
Definition at line 576 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 792 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 897 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 712 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.
|
|
|
Returns the user's current role in this room.
|
|
|
Sends a chat message to the room.
Definition at line 604 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 758 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 616 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 Unavailable with this function.
Definition at line 641 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 667 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 698 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to request room history. Set
Definition at line 691 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 727 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 610 of file mucroom.cpp. |
|
||||||||||||
|
Use this function to store a (modified) list for the room.
Definition at line 801 of file mucroom.cpp. |
1.4.1