XEP-0513: Explicit Mentions¶
- class slixmpp.plugins.xep_0513.XEP_0513(xmpp, config=None)[source]¶
This plugin add supports for XEP-0513: Explicit Mentions
- stanza = <module 'slixmpp.plugins.xep_0513.stanza' from '/build/reproducible-path/slixmpp-1.15.0/slixmpp/plugins/xep_0513/stanza.py'>¶
Stanza elements¶
Stanza interfaces for XEP-0513: Explicit Mentions
Basic usage:
>>> register_plugin() # automatically done if you use this plugin
>>> msg = Message()
>>> msg["body"] = "Hello, Alice!"
>>> msg["mention"]["begin"] = 7
>>> msg["mention"]["end"] = 12
>>> msg["mention"]["occupantid"] = "alice@occupant-id"
>>> msg.pretty_print()
<message xmlns="jabber:client">
<body>Hello, Alice!</body>
<mention xmlns="urn:xmpp:mentions:0" begin="7" end="12" occupantid="alice@occupant-id" />
</message>
- class slixmpp.plugins.xep_0513.stanza.Active(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'active'¶
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:mentions:0'¶
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] = 'active'¶
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']
- class slixmpp.plugins.xep_0513.stanza.Mention(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[set[str]] = {'begin', 'end', 'jid', 'mentions', 'occupantid', 'uri'}¶
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.
- mention_group(who)[source]¶
Mention a group of participants, see section 3.2 of the XEP.
- Return type:
- name: ClassVar[str] = 'mention'¶
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:mentions:0'¶
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] = 'mention'¶
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']
- plugin_multi_attrib: ClassVar[str] = 'mentions'¶
For
ElementBasesubclasses that are intended to be an iterable group of items, theplugin_multi_attribvalue defines an interface for the parent stanza which returns the entire group of matching substanzas. So the following are equivalent:# Given stanza class Foo, with plugin_multi_attrib = 'foos' parent['foos'] filter(isinstance(item, Foo), parent['substanzas'])
- class slixmpp.plugins.xep_0513.stanza.NoPing(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'noping'¶
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:mentions:0'¶
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] = 'noping'¶
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']