Package pyxmpp :: Package jabber :: Module muccore :: Class MucPresence
[show private | hide private]
[frames | no frames]

Class MucPresence

MucStanzaExt --+
               |
  Stanza --+   |
           |   |
    Presence --+
               |
              MucPresence


Extend `Presence` with MUC related interface.

Method Summary
  __init__(self, xmlnode, from_jid, to_jid, stanza_type, stanza_id, show, status, priority, error, error_cond)
Initialize a `MucPresence` object.
  copy(self)
Return a copy of `self`.
  free(self)
Free the data associated with this `MucPresence` object.
  get_join_info(self)
If `self` is a MUC room join request return the information contained.
  make_join_request(self, password, history_maxchars, history_maxstanzas, history_seconds, history_since)
Make the presence stanza a MUC room join request.
    Inherited from Presence
  get_priority(self)
Get presence priority.
  get_show(self)
Get presence "show" field.
  get_status(self)
Get presence status description.
  make_accept_response(self)
Create "accept" response for the "subscribe"/"subscribed"/"unsubscribe"/"unsubscribed" presence stanza.
  make_deny_response(self)
Create "deny" response for the "subscribe"/"subscribed"/"unsubscribe"/"unsubscribed" presence stanza.
  make_error_response(self, cond)
Create error response for the any non-error presence stanza.
  set_priority(self, priority)
Change presence priority.
  set_show(self, show)
Change presence "show" field.
  set_status(self, status)
Change presence status description.
    Inherited from Stanza
  __del__(self)
  __eq__(self, other)
  __ne__(self, other)
  add_content(self, content)
Add an XML node to the stanza's payload.
  add_new_content(self, ns_uri, name)
Add a new XML element to the stanza payload.
  get_error(self)
Get stanza error information.
  get_from(self)
Get "from" attribute of the stanza.
  get_from_jid(self)
Get "from" attribute of the stanza.
  get_id(self)
Get "id" attribute of the stanza.
  get_node(self)
Return the XML node wrapped into `self`.
  get_stanza_id(self)
Get "id" attribute of the stanza.
  get_stanza_type(self)
Get "type" attribute of the stanza.
  get_to(self)
Get "to" attribute of the stanza.
  get_to_jid(self)
Get "to" attribute of the stanza.
  get_type(self)
Get "type" attribute of the stanza.
  serialize(self)
Serialize the stanza into an UTF-8 encoded XML string.
  set_content(self, content)
Set stanza content to an XML node.
  set_from(self, from_jid)
Set "from" attribute of the stanza.
  set_id(self, stanza_id)
Set "id" attribute of the stanza.
  set_new_content(self, ns_uri, name)
Set stanza payload to a new XML element.
  set_to(self, to_jid)
Set "to" attribute of the stanza.
  set_type(self, stanza_type)
Set "type" attribute of the stanza.
  xpath_eval(self, expr, namespaces)
Evaluate an XPath expression on the stanza XML node.
    Inherited from MucStanzaExt
  clear_muc_child(self)
Remove the MUC specific stanza payload element.
  get_muc_child(self)
Get the MUC specific payload element.
  make_muc_admin_quey(self)
Create <query xmlns="...muc#admin"/> element in the stanza.
  make_muc_userinfo(self)
Create <x xmlns="...muc#user"/> element in the stanza.
  muc_free(self)
Free MUC specific data.

Class Variable Summary
    Inherited from Presence
str stanza_type = 'presence'

Method Details

__init__(self, xmlnode=None, from_jid=None, to_jid=None, stanza_type=None, stanza_id=None, show=None, status=None, priority=0, error=None, error_cond=None)
(Constructor)

Initialize a `MucPresence` object.

:Parameters:
    - `xmlnode`: XML node to_jid be wrapped into the `MucPresence` object
      or other Presence object to be copied. If not given then new
      presence stanza is created using following parameters.
    - `from_jid`: sender JID.
    - `to_jid`: recipient JID.
    - `stanza_type`: staza type: one of: None, "available", "unavailable",
      "subscribe", "subscribed", "unsubscribe", "unsubscribed" or
      "error". "available" is automaticaly changed to_jid None.
    - `stanza_id`: stanza id -- value of stanza's "id" attribute
    - `show`: "show" field of presence stanza. One of: None, "away",
      "xa", "dnd", "chat".
    - `status`: descriptive text for the presence stanza.
    - `priority`: presence priority.
    - `error_cond`: error condition name. Ignored if `stanza_type` is not "error"
:Types:
    - `xmlnode`: `unicode` or `libxml2.xmlNode` or `pyxmpp.stanza.Stanza`
    - `from_jid`: `JID`
    - `to_jid`: `JID`
    - `stanza_type`: `unicode`
    - `stanza_id`: `unicode`
    - `show`: `unicode`
    - `status`: `unicode`
    - `priority`: `unicode`
    - `error_cond`: `unicode`
Overrides:
pyxmpp.presence.Presence.__init__

copy(self)

Return a copy of `self`.
Overrides:
pyxmpp.presence.Presence.copy

free(self)

Free the data associated with this `MucPresence` object.
Overrides:
pyxmpp.stanza.Stanza.free

get_join_info(self)

If `self` is a MUC room join request return the information contained.

:return: the join request details or `None`.
:returntype: `MucX`

make_join_request(self, password=None, history_maxchars=None, history_maxstanzas=None, history_seconds=None, history_since=None)

Make the presence stanza a MUC room join request.

:Parameters:
    - `password`: password to the room.
    - `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
      `seconds` seconds.
    - `history_since`: Send only the messages received since the
      dateTime specified (UTC).
:Types:
    - `password`: `unicode`
    - `history_maxchars`: `int`
    - `history_maxstanzas`: `int`
    - `history_seconds`: `int`
    - `history_since`: `datetime.datetime`

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