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

Class MucRoomManager


Manage collection of MucRoomState objects and dispatch events.

:Ivariables:
  - `rooms`: a dictionary containing known MUC rooms. Unicode room JIDs are the
    keys.
  - `stream`: the stream associated with the room manager.

Method Summary
  __init__(self, stream)
Initialize a `MucRoomManager` object.
  forget(self, rs)
Remove a room from the list of managed rooms.
  get_room_state(self, room)
Get the room state object of a room.
  join(self, room, nick, handler, password, history_maxchars, history_maxstanzas, history_seconds, history_since)
Create and return a new room state object and request joining to a MUC room.
  set_handlers(self, priority)
Assign MUC stanza handlers to the `self.stream`.
  set_stream(self, stream)
Change the stream assigned to `self`.
  __error_message(self, stanza)
Process an error message from a MUC room.
  __groupchat_message(self, stanza)
Process a groupchat message from a MUC room.
  __presence_available(self, stanza)
Process an available presence from a MUC room.
  __presence_error(self, stanza)
Process an presence error from a MUC room.
  __presence_unavailable(self, stanza)
Process an unavailable presence from a MUC room.

Method Details

__init__(self, stream)
(Constructor)

Initialize a `MucRoomManager` object.

:Parameters:
    - `stream`: a stream to be initially assigned to `self`.
:Types:
    - `stream`: `pyxmpp.stream.Stream`

forget(self, rs)

Remove a room from the list of managed rooms.

:Parameters:
    - `rs`: the state object of the room.
:Types:
    - `rs`: `MucRoomState`

get_room_state(self, room)

Get the room state object of a room.

:Parameters:
    - `room`: JID or the room which state is requested.
:Types:
    - `room`: `JID`

:return: the state object.
:returntype: `MucRoomState`

join(self, room, nick, handler, password=None, history_maxchars=None, history_maxstanzas=None, history_seconds=None, history_since=None)

Create and return a new room state object and request joining
to a MUC room.

:Parameters:
    - `room`: the name of a room to be joined
    - `nick`: the nickname to be used in the room
    - `handler`: is an object to handle room events.
    - `password`: password for the room, if any
    - `history_maxchars`: limit of the total number of characters in
      history.
    - `history_maxstanzas`: limit of the total number of messages in
      history.
    - `history_seconds`: send only messages received in the last
      `history_seconds` seconds.
    - `history_since`: Send only the messages received since the
      dateTime specified (UTC).

:Types:
    - `room`: `JID`
    - `nick`: `unicode`
    - `handler`: `MucRoomHandler`
    - `password`: `unicode`
    - `history_maxchars`: `int`
    - `history_maxstanzas`: `int`
    - `history_seconds`: `int`
    - `history_since`: `datetime.datetime`

:return: the room state object created.
:returntype: `MucRoomState`

set_handlers(self, priority=10)

Assign MUC stanza handlers to the `self.stream`.

:Parameters:
    - `priority`: priority for the handlers.
:Types:
    - `priority`: `int`

set_stream(self, stream)

Change the stream assigned to `self`.

:Parameters:
    - `stream`: the new stream to be assigned to `self`.
:Types:
    - `stream`: `pyxmpp.stream.Stream`

__error_message(self, stanza)

Process an error message from a MUC room.

:Parameters:
    - `stanza`: the stanza received.
:Types:
    - `stanza`: `Message`

:return: `True` if the message was properly recognized as directed to
    one of the managed rooms, `False` otherwise.
:returntype: `bool`

__groupchat_message(self, stanza)

Process a groupchat message from a MUC room.

:Parameters:
    - `stanza`: the stanza received.
:Types:
    - `stanza`: `Message`

:return: `True` if the message was properly recognized as directed to
    one of the managed rooms, `False` otherwise.
:returntype: `bool`

__presence_available(self, stanza)

Process an available presence from a MUC room.

:Parameters:
    - `stanza`: the stanza received.
:Types:
    - `stanza`: `Presence`

:return: `True` if the stanza was properly recognized as generated by
    one of the managed rooms, `False` otherwise.
:returntype: `bool`

__presence_error(self, stanza)

Process an presence error from a MUC room.

:Parameters:
    - `stanza`: the stanza received.
:Types:
    - `stanza`: `Presence`

:return: `True` if the stanza was properly recognized as generated by
    one of the managed rooms, `False` otherwise.
:returntype: `bool`

__presence_unavailable(self, stanza)

Process an unavailable presence from a MUC room.

:Parameters:
    - `stanza`: the stanza received.
:Types:
    - `stanza`: `Presence`

:return: `True` if the stanza was properly recognized as generated by
    one of the managed rooms, `False` otherwise.
:returntype: `bool`

Generated by Epydoc 2.1 on Wed May 31 22:36:58 2006 http://epydoc.sf.net