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 ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mentions:0'

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'active'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_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]
get_begin()[source]
Return type:

int | None

get_end()[source]
Return type:

int | None

get_jid()[source]
Return type:

JID | None

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_attrib value of any registered stanza plugins.

mention_group(who)[source]

Mention a group of participants, see section 3.2 of the XEP.

Return type:

None

name: ClassVar[str] = 'mention'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mentions:0'

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mention'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugin_multi_attrib: ClassVar[str] = 'mentions'

For ElementBase subclasses that are intended to be an iterable group of items, the plugin_multi_attrib value 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'])
set_begin(begin)[source]
Return type:

None

set_end(end)[source]
Return type:

None

set_jid(jid)[source]
Return type:

None

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 ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mentions:0'

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'noping'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
slixmpp.plugins.xep_0513.stanza.register_plugin()[source]
Return type:

None