Package pyxmpp :: Package jabber :: Module muc :: Class MucRoomHandler
[show private | hide private]
[frames | no frames]

Class MucRoomHandler


Base class for MUC room handlers.

Methods of this class will be called for various events in the room.


Method Summary
  __init__(self)
Initialize a MucRoomHandler object.
  affiliation_changed(self, user, old_aff, new_aff, stanza)
Called when a affiliation of an user has been changed.
  assign_state(self, state_obj)
Assign a state object to this MucRoomHandler instance.
  configuration_form_received(self, form)
Called when a requested configuration form is received.
  error(self, stanza)
Called when an error stanza is received.
  message_received(self, user, stanza)
Called when groupchat message has been received.
  nick_change(self, user, new_nick, stanza)
Called when user nick change is started.
  nick_changed(self, user, old_nick, stanza)
Called after a user nick has been changed.
  presence_changed(self, user, stanza)
Called whenever user's presence changes (includes nick, role or affiliation changes).
  role_changed(self, user, old_role, new_role, stanza)
Called when a role of an user has been changed.
  room_configuration_error(self, stanza)
Called when an error stanza is received in reply to a room configuration request.
  room_configured(self)
Called after a successfull room configuration.
  room_created(self, stanza)
Called when the room has been created.
  subject_changed(self, user, stanza)
Called when the room subject has been changed.
  user_joined(self, user, stanza)
Called when a new participant joins the room.
  user_left(self, user, stanza)
Called when a participant leaves the room.

Instance Variable Summary
  room_state: MucRoomState object describing room state and its participants.

Method Details

__init__(self)
(Constructor)

Initialize a MucRoomHandler object.

affiliation_changed(self, user, old_aff, new_aff, stanza)

Called when a affiliation of an user has been changed.

user MucRoomUser object describing the user (after update). old_aff is user's affiliation before update. new_aff is user's affiliation after update. stanza the stanza received.

assign_state(self, state_obj)

Assign a state object to this MucRoomHandler instance.
Parameters:
state_obj - the state object.
           (type=MucRoomState)

configuration_form_received(self, form)

Called when a requested configuration form is received.

The form, after filling-in shoul be passed to self.room_state.configure_room.

Parameters:
form - the configuration form.
           (type=pyxmpp.jabber.dataforms.Form)

error(self, stanza)

Called when an error stanza is received.
Parameters:
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

message_received(self, user, stanza)

Called when groupchat message has been received.
Parameters:
user - the sender.
           (type=MucRoomUser)
stanza - is the message stanza received.
           (type=pyxmpp.stanza.Stanza)

nick_change(self, user, new_nick, stanza)

Called when user nick change is started.
Parameters:
user - the user (before update).
           (type=MucRoomUser)
new_nick - the new nick.
           (type=unicode)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

nick_changed(self, user, old_nick, stanza)

Called after a user nick has been changed.
Parameters:
user - the user (after update).
           (type=MucRoomUser)
old_nick - the old nick.
           (type=unicode)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

presence_changed(self, user, stanza)

Called whenever user's presence changes (includes nick, role or affiliation changes).
Parameters:
user - MucRoomUser object describing the user.
           (type=MucRoomUser)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

role_changed(self, user, old_role, new_role, stanza)

Called when a role of an user has been changed.
Parameters:
user - the user (after update).
           (type=MucRoomUser)
old_role - user's role before update.
           (type=unicode)
new_role - user's role after update.
           (type=unicode)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

room_configuration_error(self, stanza)

Called when an error stanza is received in reply to a room configuration request.

By default self.error is called.

Parameters:
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

room_configured(self)

Called after a successfull room configuration.

room_created(self, stanza)

Called when the room has been created.

Default action is to request an "instant room" by accepting the default configuration. Instead the application may want to request a configuration form and submit it.

Parameters:
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

subject_changed(self, user, stanza)

Called when the room subject has been changed.
Parameters:
user - the user changing the subject.
           (type=MucRoomUser)
stanza - the stanza used to change the subject.
           (type=pyxmpp.stanza.Stanza)

user_joined(self, user, stanza)

Called when a new participant joins the room.
Parameters:
user - the user joining.
           (type=MucRoomUser)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

user_left(self, user, stanza)

Called when a participant leaves the room.
Parameters:
user - the user leaving.
           (type=MucRoomUser)
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

Instance Variable Details

room_state

MucRoomState object describing room state and its participants.