XEP-0463: MUC Affiliation Versioning¶
- class slixmpp.plugins.xep_0463.XEP_0463(xmpp, config=None)[source]¶
XEP-0463: MUC Affilition Versioning
This plugin does only one thing: it registers the stanza plugins.
- stanza = <module 'slixmpp.plugins.xep_0463.stanza' from '/home/docs/checkouts/readthedocs.org/user_builds/slixmpp/checkouts/slix-1.16.0/slixmpp/plugins/xep_0463/stanza.py'>¶
Stanza elements¶
Usage:
>>> register_plugin(for_doctests=True) # automatically done when enabling the XEP_0463 plugin
>>> presence = Presence()
>>> presence["muc_join"]["mav"]["since"] = "opaque-ver"
>>> presence.pretty_print()
<presence xmlns="jabber:client">
<x xmlns="http://jabber.org/protocol/muc">
<mav xmlns="urn:xmpp:muc:affiliations:1" since="opaque-ver" />
</x>
</presence>
>>> msg = Message()
>>> msg["muc"]["mav"]["since"] = "since-ver"
>>> msg["muc"]["mav"]["until"] = "until-ver"
>>> msg.pretty_print()
<message xmlns="jabber:client">
<x xmlns="http://jabber.org/protocol/muc#user">
<mav xmlns="urn:xmpp:muc:affiliations:1" since="since-ver" until="until-ver" />
</x>
</message>
>>> presence = Presence()
>>> presence["muc"]["mav"]["until"] = "XXX"
>>> presence.pretty_print()
<presence xmlns="jabber:client">
<x xmlns="http://jabber.org/protocol/muc#user">
<mav xmlns="urn:xmpp:muc:affiliations:1" until="XXX" />
</x>
</presence>
- class slixmpp.plugins.xep_0463.stanza.Mav(xml=None, parent=None)[source]¶
- interfaces: ClassVar[set[str]] = {'since', 'until'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'mav'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:muc:affiliations:1'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'mav'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']