gloox  1.0.1
Public Member Functions | List of all members
MUCRoomHandler Class Reference

#include <mucroomhandler.h>

Public Member Functions

virtual ~MUCRoomHandler ()
virtual void handleMUCParticipantPresence (MUCRoom *room, const MUCRoomParticipant participant, const Presence &presence)=0
virtual void handleMUCMessage (MUCRoom *room, const Message &msg, bool priv)=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 Disco::ItemList &items)=0

Detailed Description

This interface enables inheriting classes to be notified about certain events in a MUC room.

See MUCRoom for examples how to use this interface.

Note
This interface does not notify about room configuration related events. Use MUCRoomConfigHandler for that puprose.
Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 90 of file mucroomhandler.h.

Constructor & Destructor Documentation

virtual ~MUCRoomHandler ( )
inlinevirtual

Virtual Destructor.

Definition at line 96 of file mucroomhandler.h.

Member Function Documentation

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.

Note
The following error conditions are specified for MUC:
  • Not Authorized: Password required.
  • Forbidden: Access denied, user is banned.
  • Item Not Found: The room does not exist.
  • Not Allowed: Room creation is restricted.
  • Not Acceptable: Room nicks are locked down.
  • Registration Required: User is not on the member list.
  • Conflict: Desired room nickname is in use or registered by another user.
  • Service Unavailable: Maximum number of users has been reached.
Other errors might appear, depending on the service implementation.
Parameters
roomThe room.
errorThe 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().

Parameters
roomThe room.
featuresORed MUCRoomFlag's.
nameThe room's name as returned by Service Discovery.
infoFormA 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. You should not delete the form.
Note
This function may be called without a prior call to MUCRoom::getRoomInfo(). This happens if the room config is changed, e.g. by a room admin.
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.

Parameters
roomThe room.
inviteeThe JID if the person that declined the invitation.
reasonAn optional reason for declining the invitation.
virtual void handleMUCItems ( MUCRoom room,
const Disco::ItemList items 
)
pure virtual

This function is called in response to a call to MUCRoom::getRoomItems().

Parameters
roomThe room.
itemsA 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.
virtual void handleMUCMessage ( MUCRoom room,
const Message msg,
bool  priv 
)
pure virtual

This function is called when a message arrives through the room.

Note
This may be a private message! If the message is private, and you want to answer it privately, you should create a new MessageSession to the user's full room nick and use that for any further private communication with the user.
Parameters
roomThe room the message came from.
msgThe entire Message.
privIndicates whether this is a private message.
Note
The sender's nick name can be obtained with this call:
const std::string nick = msg.from().resource();
The message may contain an extension of type DelayedDelivery describing the date/time when the message was originally sent. The presence of such an extension usually indicates that the message is sent as part of the room history. This extension can be obtained with this call:
const DelayedDelivery* dd = msg.when(); // may be 0 if no such extension exists
virtual void handleMUCParticipantPresence ( MUCRoom room,
const MUCRoomParticipant  participant,
const Presence presence 
)
pure virtual

This function is called whenever a room occupant enters the room, changes presence inside the room, or leaves the room.

Note
The MUCRoomParticipant struct, including pointers to JIDs, will be cleaned up after this function returned.
Parameters
roomThe room.
participantA struct describing the occupant's status and/or action.
presenceThe occupant's full presence.
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:

Parameters
roomThe room.
Returns
True to accept the default room configuration, false to keep the room locked until configured manually by the room owner.
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.

Parameters
roomThe room.
nickThe nick of the occupant that changed the room subject.
Note
With some MUC services the nick may be empty when a room is first entered.
Parameters
subjectThe new room subject.

The documentation for this class was generated from the following file: