#include <mucroomhandler.h>
Public Member Functions | |
virtual | ~MUCRoomHandler () |
virtual void | handleMUCParticipantPresence (MUCRoom *room, const MUCRoomParticipant participant, Presence presence)=0 |
virtual void | handleMUCMessage (MUCRoom *room, const std::string &nick, const std::string &message, bool history, const std::string &when, bool privateMessage)=0 |
virtual bool | handleMUCRoomCreation (MUCRoom *room)=0 |
virtual void | handleMUCSubject (MUCRoom *room, const std::string &nick, const std::string &subject)=0 |
virtual void | handleMUCInviteDecline (MUCRoom *room, const JID &invitee, const std::string &reason)=0 |
virtual void | handleMUCError (MUCRoom *room, StanzaError error)=0 |
virtual void | handleMUCInfo (MUCRoom *room, int features, const std::string &name, const DataForm *infoForm)=0 |
virtual void | handleMUCItems (MUCRoom *room, const StringMap &items)=0 |
See MUCRoom for examples how to use this interface.
Definition at line 87 of file mucroomhandler.h.
virtual ~MUCRoomHandler | ( | ) | [inline, virtual] |
Virtual Destructor.
Definition at line 93 of file mucroomhandler.h.
virtual void handleMUCParticipantPresence | ( | MUCRoom * | room, | |
const MUCRoomParticipant | participant, | |||
Presence | presence | |||
) | [pure virtual] |
This function is called whenever a room occupant enters the room, changes presence inside the room, or leaves the room.
room | The room. | |
participant | A struct describing the occupant's status and/or action. | |
presence | The occupant's presence. |
virtual void handleMUCMessage | ( | MUCRoom * | room, | |
const std::string & | nick, | |||
const std::string & | message, | |||
bool | history, | |||
const std::string & | when, | |||
bool | privateMessage | |||
) | [pure virtual] |
This function is called when a message arrives through the room.
room | The room the message came from. | |
nick | The sending user's nickname in the room. | |
message | The message. | |
history | Indicates whether or not this is a message that was sent prior to entering the room and is part of the room history the room sends after joining. | |
when | This is only used if history is true and then contains the datetime the message was sent in a notation as described in XEP-0082. | |
privateMessage | Indicates whether this is a private message. |
virtual bool handleMUCRoomCreation | ( | MUCRoom * | room | ) | [pure virtual] |
This function is called if the room that was just joined didn't exist prior to the attempted join. Therfore the room was created by MUC service. To accept the default configuration of the room assigned by the MUC service, return true from this function. The room will be opened by the MUC service and available for other users to join. If you don't want to accept the default room configuration, return false from this function. The room will stay locked until it is either fully configured, created as an instant room, or creation is canceled.
If you returned false from this function you should use one of the following options:
room | The room. |
virtual void handleMUCSubject | ( | MUCRoom * | room, | |
const std::string & | nick, | |||
const std::string & | subject | |||
) | [pure virtual] |
This function is called when the room subject has been changed.
room | The room. | |
nick | The nick of the occupant that changed the room subject. |
subject | The new room subject. |
virtual void handleMUCInviteDecline | ( | MUCRoom * | room, | |
const JID & | invitee, | |||
const std::string & | reason | |||
) | [pure virtual] |
This function is called when the user invited somebody (e.g., by using MUCRoom::invite()) to the room, but the invitation was declined by that person.
room | The room. | |
invitee | The JID if the person that declined the invitation. | |
reason | An optional reason for declining the invitation. |
virtual void handleMUCError | ( | MUCRoom * | room, | |
StanzaError | error | |||
) | [pure virtual] |
This function is called when an error occurs in the room or when entering the room.
room | The room. | |
error | The error. |
virtual void handleMUCInfo | ( | MUCRoom * | room, | |
int | features, | |||
const std::string & | name, | |||
const DataForm * | infoForm | |||
) | [pure virtual] |
This function usually (see below) is called in response to a call to MUCRoom::getRoomInfo().
room | The room. | |
features | ORed MUCRoomFlag's. | |
name | The room's name as returned by Service Discovery. | |
infoForm | A DataForm containing extended room information. May be 0 if the service doesn't support extended room information. See Section 15.5 of XEP-0045 for defined field types. |
This function is called in response to a call to MUCRoom::getRoomItems().
room | The room. | |
items | A map of room participants. The key is the name, the value is the occupant's room JID. The map may be empty if such info is private. |