XEP-0045: Multi-User Chat¶
- class slixmpp.plugins.xep_0045.XEP_0045(xmpp, config=None)[source]¶
XEP-0045 Multi-User Chat.
This XEP is made for use by clients or components acting as clients. If a component is made to act as MUC service, it should only care about the events and the stanza plugins.
A single component may want to simulate joins as multiple entities, in which case it should enable the multi_from config option.
- name: str = 'xep_0045'¶
A short name for the plugin based on the implemented specification. For example, a plugin for XEP-0030 would use ‘xep_0030’.
- description: str = 'XEP-0045: Multi-User Chat'¶
A longer name for the plugin, describing its purpose. For example, a plugin for XEP-0030 would use ‘Service Discovery’ as its description value.
- dependencies: ClassVar[Set[str]] = {'xep_0004', 'xep_0030', 'xep_0172', 'xep_0203'}¶
Some plugins may depend on others in order to function properly. Any plugin names included in
dependencies
will be initialized as needed if this plugin is enabled.
- default_config: ClassVar[Dict[str, Any]] = {'multi_from': False}¶
The basic, standard configuration for the plugin, which may be overridden when initializing the plugin. The configuration fields included here may be accessed directly as attributes of the plugin. For example, including the configuration field ‘foo’ would mean accessing plugin.foo returns the current value of plugin.config[‘foo’].
- make_join_stanza(room, nick, *, password=None, maxchars=None, maxstanzas=None, seconds=None, since=None, presence_options=None)[source]¶
Build the stanza for the MUC join, without sending it.
Only one of {maxchars, maxstanzas, seconds, since} will be used, in that order.
Added in version 1.9.0.
- Parameters:
room (
JID
) – Room JIDnick (
str
) – User nickname in the roompassword (
Optional
[str
]) – The optional room password.maxchars (
Optional
[int
]) – Max number of characters to return from history.maxstanzas (
Optional
[int
]) – Max number of stanzas to return from history.seconds (
Optional
[int
]) – Fetch history until that many seconds in the past.since (
Optional
[datetime
]) – Fetch history since that timestamp.
- Return type:
- Returns:
The presence stanza to send
- async join_muc_wait(room, nick, *, password=None, maxchars=None, maxstanzas=None, seconds=None, since=None, presence_options=None, timeout=300)[source]¶
Try to join a MUC and block until we are joined or get an error.
Only one of {maxchars, maxstanzas, seconds, since} will be used, in that order.
Added in version 1.8.0.
- Parameters:
room (
JID
) – Room JIDnick (
str
) – User nickname in the roompassword (
Optional
[str
]) – The optional room password.maxchars (
Optional
[int
]) – Max number of characters to return from history.maxstanzas (
Optional
[int
]) – Max number of stanzas to return from history.seconds (
Optional
[int
]) – Fetch history until that many seconds in the past.since (
Optional
[datetime
]) – Fetch history since that timestamp.timeout (
int
) – Timeout after which a TimeoutError is raised. None means no timeout.
- Raises:
A slixmpp.exceptions.PresenceError if the MUC returns a presence error.
- Raises:
An asyncio.TimeoutError if there is neither success nor presence error when the timeout is reached.
- Return type:
- Returns:
A tuple containing our own presence, the subject, a list of occupants and a list of history messages.
- join_muc(room, nick, maxhistory='0', password='', pstatus='', pshow='chat', pfrom='')[source]¶
Join the specified room, requesting ‘maxhistory’ lines of history. :rtype:
Future
Deprecated since version 1.8.0:
join_muc_wait()
will replace this old API starting from version 1.9.0.
- leave_muc(room, nick, msg='', pfrom=None)[source]¶
Leave the specified room.
- Parameters:
room (
JID
) – Room to leave.nick (
str
) – Your nickname.msg (
str
) – Presence status to use.
- Raises:
KeyError if the room is not in our room list.
- set_subject(room, subject, *, mfrom=None)[source]¶
Set a room’s subject.
- Parameters:
room (
Union
[str
,JID
]) – JID of the room.subject (
str
) – Room subject to set.
- async get_room_config(room, ifrom=None, **iqkwargs)[source]¶
Get the room config form in 0004 plugin format.
- Parameters:
room (
Union
[str
,JID
]) – Room to get the config form from.- Raises:
ValueError – When the form is not found.
- Return type:
- Returns:
A form object.
- async cancel_config(room, *, ifrom=None, **iqkwargs)[source]¶
Cancel a requested config form.
- Parameters:
room (
Union
[str
,JID
]) – Room to cancel the form for.
- async set_affiliation(room, affiliation, *, jid=None, nick=None, reason='', ifrom=None, **iqkwargs)[source]¶
Change room affiliation for a JID or nickname.
- async get_affiliation_list(room, affiliation, *, ifrom=None, **iqkwargs)[source]¶
Get a list of JIDs with the specified affiliation
- async send_affiliation_list(room, affiliations, *, ifrom=None, **iqkwargs)[source]¶
Send an affiliation delta list.
- async set_role(room, nick, role, *, reason='', ifrom=None, **iqkwargs)[source]¶
Change role property of a nick in a room. Typically, roles are temporary (they last only as long as you are in the room), whereas affiliations are permanent (they last across groupchat sessions).
- Parameters:
room (
Union
[str
,JID
]) – Room to modify.nick (
str
) – User nickname to use in the set operation.role (
Literal
['moderator'
,'participant'
,'visitor'
,'none'
]) – Role to set.reason (
str
) – Reason for the role change.
- async get_roles_list(room, role, *, ifrom=None, **iqkwargs)[source]¶
“Get a list of JIDs with the specified role
- Parameters:
room (
Union
[str
,JID
]) – Room to get roles from.role (
Literal
['moderator'
,'participant'
,'visitor'
,'none'
]) – The role to list.
- Return type:
List
[str
]
- async send_role_list(room, roles, *, ifrom=None, **iqkwargs)[source]¶
Send a role delta list.
- Parameters:
room (
Union
[str
,JID
]) – Room to send the roles to.roles (
List
[Tuple
[str
,Literal
['moderator'
,'participant'
,'visitor'
,'none'
]]]) – List of couples (nick, role) to set.
- invite_server(room, jid, invite_from, reason='')[source]¶
Send a mediated invite to a user, as a MUC service.
Added in version 1.8.0.
- request_voice(room, role, *, mfrom=None)[source]¶
Request voice in a moderated room.
- Parameters:
room (
Union
[str
,JID
]) – Room to request voice from.
- async set_self_nick(room, new_nick, timeout=60, presence_options=None)[source]¶
Set your nickname in a room. The room can arbitrarily decide on another nickname, so this function waits for the response and returns the final nickname.
Added in version 1.9.0.
- Parameters:
room (
JID
) – Room in which to change our nicknamenew_nick (
str
) – Our new nickname in the roomtimeout (
int
) – Time to wait for our new nickname responsepfrom – (for components) the JID to send our presence from
- Return type:
str
- get_joined_rooms(pfrom=None)[source]¶
Get the list of rooms we sent a join presence to and did not explicitly leave.
- Return type:
List
[JID
]
- get_our_jid_in_room(room_jid, pfrom=None)[source]¶
Return the jid we’re using in a room.
- Return type:
str
- get_jid_property(room, nick, jid_property, pfrom=None)[source]¶
- Get the property of a nick in a room, such as its ‘jid’ or ‘affiliation’
If not found, return None.
- Parameters:
room (
JID
) – Get the property for this room.nick (
str
) – Which nickname information to get.jid_property (
Literal
['jid'
,'role'
,'affiliation'
,'show'
,'status'
,'alt_nick'
]) – Property to fetch.
- Return type:
Any
- get_roster(room, pfrom=None)[source]¶
Get the list of nicks in a room.
- Parameters:
room (
JID
) – Room to list nicks from.- Return type:
List
[str
]
- join_groupchat(room, nick, maxhistory='0', password='', pstatus='', pshow='chat', pfrom='')¶
Join the specified room, requesting ‘maxhistory’ lines of history. :rtype:
Future
Deprecated since version 1.8.0:
join_muc_wait()
will replace this old API starting from version 1.9.0.
- async join_groupchat_wait(room, nick, *, password=None, maxchars=None, maxstanzas=None, seconds=None, since=None, presence_options=None, timeout=300)¶
Try to join a MUC and block until we are joined or get an error.
Only one of {maxchars, maxstanzas, seconds, since} will be used, in that order.
Added in version 1.8.0.
- Parameters:
room (
JID
) – Room JIDnick (
str
) – User nickname in the roompassword (
Optional
[str
]) – The optional room password.maxchars (
Optional
[int
]) – Max number of characters to return from history.maxstanzas (
Optional
[int
]) – Max number of stanzas to return from history.seconds (
Optional
[int
]) – Fetch history until that many seconds in the past.since (
Optional
[datetime
]) – Fetch history since that timestamp.timeout (
int
) – Timeout after which a TimeoutError is raised. None means no timeout.
- Raises:
A slixmpp.exceptions.PresenceError if the MUC returns a presence error.
- Raises:
An asyncio.TimeoutError if there is neither success nor presence error when the timeout is reached.
- Return type:
- Returns:
A tuple containing our own presence, the subject, a list of occupants and a list of history messages.
Stanza elements¶
- class slixmpp.plugins.xep_0045.stanza.MUCActor(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[Set[str]] = {'jid', 'nick'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'actor'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'actor'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCAdminItem(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'affiliation', 'jid', 'nick', 'reason', 'role'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'item'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#admin'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'item'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCAdminQuery(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'query'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#admin'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'mucadmin_query'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCBase(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[Set[str]] = {'affiliation', 'item_nick', 'jid', 'nick', 'role', 'room', 'status_codes'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'x'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'muc'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCDecline(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[Set[str]] = {'from', 'reason', 'to'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'decline'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'decline'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCDestroy(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'jid', 'reason'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'destroy'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'destroy'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCHistory(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'maxchars', 'maxstanzas', 'seconds', 'since'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'history'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'history'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCInvite(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[Set[str]] = {'from', 'reason', 'to'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'invite'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'invite'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCJoin(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'password'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'x'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'muc_join'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'password'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCMessage(xml=None, parent=None)[source]¶
A MUC Message
<message from='foo@muc/user1' type='groupchat' id='someid'> <body>Foo</body> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none' nick='newnick2' jid='some@jid'/> </x> </message>
- class slixmpp.plugins.xep_0045.stanza.MUCOwnerDestroy(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'jid', 'reason'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'destroy'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#owner'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'destroy'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.
- class slixmpp.plugins.xep_0045.stanza.MUCOwnerQuery(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'query'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#owner'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'mucowner_query'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCPresence(xml=None, parent=None)[source]¶
A MUC Presence
<presence from='foo@muc/user1' type='unavailable'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none' nick='newnick2' jid='some@jid'/> <status code='303'/> </x> </presence>
- class slixmpp.plugins.xep_0045.stanza.MUCStatus(xml=None, parent=None)[source]¶
- interfaces: ClassVar[Set[str]] = {'code'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'status'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'status'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0045.stanza.MUCUserItem(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[Set[str]] = {'affiliation', 'jid', 'nick', 'reason', 'role'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attrib
value of any registered stanza plugins.
- name: ClassVar[str] = 'item'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'http://jabber.org/protocol/muc#user'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber:client
since this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'item'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[Set[str]] = {'reason'}¶
A subset of
interfaces
which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.