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

# Class MucRoomManager

source code

Manage collection of MucRoomState objects and dispatch events.

Instance Methods | [hide private]
__init__(self, stream) Initialize a MucRoomManager object. | source code
set_stream(self, stream) Change the stream assigned to `self`. | source code
set_handlers(self, priority=10) Assign MUC stanza handlers to the self.stream. | source code
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. | source code
MucRoomState |
get_room_state(self, room) Get the room state object of a room. | source code
forget(self, rs) Remove a room from the list of managed rooms. | source code
`bool` |
__groupchat_message(self, stanza) Process a groupchat message from a MUC room. | source code
`bool` |
__error_message(self, stanza) Process an error message from a MUC room. | source code
`bool` |
__presence_error(self, stanza) Process an presence error from a MUC room. | source code
`bool` |
__presence_available(self, stanza) Process an available presence from a MUC room. | source code
`bool` |
__presence_unavailable(self, stanza) Process an unavailable presence from a MUC room. | source code

Instance Variables | [hide private]
| rooms : a dictionary containing known MUC rooms.
| stream : the stream associated with the room manager.

Method Details | [hide private]

### __init__(self, stream) (Constructor) | source code
Initialize a MucRoomManager object. Parameters: `stream` (: pyxmpp.stream.Stream) - : a stream to be initially assigned to `self`.

### set_stream(self, stream) | source code
Change the stream assigned to `self`. Parameters: `stream` (: pyxmpp.stream.Stream) - : the new stream to be assigned to `self`.

### set_handlers(self, priority=10) | source code
Assign MUC stanza handlers to the self.stream. Parameters: `priority` (: `int`) - : priority for the handlers.

### join(self, room, nick, handler, password=None, history_maxchars=None, history_maxstanzas=None, history_seconds=None, history_since=None) | source code
Create and return a new room state object and request joining to a MUC room. Parameters: `room` (: JID) - : the name of a room to be joined `nick` (: `unicode`) - : the nickname to be used in the room `handler` (: MucRoomHandler) - : is an object to handle room events. `password` (: `unicode`) - : password for the room, if any `history_maxchars` (: `int`) - : limit of the total number of characters in history. `history_maxstanzas` (: `int`) - : limit of the total number of messages in history. `history_seconds` (: `int`) - : send only messages received in the last `history_seconds` seconds. `history_since` (: `datetime.datetime`) - : Send only the messages received since the dateTime specified (UTC). Returns: MucRoomState the room state object created.

### get_room_state(self, room) | source code
Get the room state object of a room. Parameters: `room` (: JID) - : JID or the room which state is requested. Returns: MucRoomState the state object.

### forget(self, rs) | source code
Remove a room from the list of managed rooms. Parameters: `rs` (: MucRoomState) - : the state object of the room.

### __groupchat_message(self, stanza) | source code
Process a groupchat message from a MUC room. Parameters: `stanza` (: Message) - : the stanza received. Returns: `bool` `True` if the message was properly recognized as directed to one of the managed rooms, `False` otherwise.

### __error_message(self, stanza) | source code
Process an error message from a MUC room. Parameters: `stanza` (: Message) - : the stanza received. Returns: `bool` `True` if the message was properly recognized as directed to one of the managed rooms, `False` otherwise.

### __presence_error(self, stanza) | source code
Process an presence error from a MUC room. Parameters: `stanza` (: Presence) - : the stanza received. Returns: `bool` `True` if the stanza was properly recognized as generated by one of the managed rooms, `False` otherwise.

### __presence_available(self, stanza) | source code
Process an available presence from a MUC room. Parameters: `stanza` (: Presence) - : the stanza received. Returns: `bool` `True` if the stanza was properly recognized as generated by one of the managed rooms, `False` otherwise.

### __presence_unavailable(self, stanza) | source code
Process an unavailable presence from a MUC room. Parameters: `stanza` (: Presence) - : the stanza received. Returns: `bool` `True` if the stanza was properly recognized as generated by one of the managed rooms, `False` otherwise.

Instance Variable Details | [hide private]

### rooms : a dictionary containing known MUC rooms. Unicode room JIDs are the keys.