MUCRoomHandler Class Reference

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

#include <mucroomhandler.h>

List of all members.

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


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@camaya.net>
Since:
0.9

Definition at line 87 of file mucroomhandler.h.


Constructor & Destructor Documentation

virtual ~MUCRoomHandler (  )  [inline, virtual]

Virtual Destructor.

Definition at line 93 of file mucroomhandler.h.


Member Function Documentation

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.

Note:
The MUCRoomParticipant struct, including pointers to JIDs, will be cleaned up after this function returned.
Parameters:
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.

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:
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:

Parameters:
room The 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:
room The room.
nick The 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:
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.

Parameters:
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.

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:
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().

Parameters:
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.
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 handleMUCItems ( MUCRoom room,
const StringMap items 
) [pure virtual]

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

Parameters:
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.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 08:50:38 2007 for gloox by  doxygen 1.5.3-20071008