XEP 0152

1.7 Documentation

«  XEP 0133   ::   Contents   ::   XEP 0153  »

XEP 0152

class slixmpp.plugins.xep_0152.XEP_0152(xmpp, config=None)[source]

XEP-0152: Reachability Addresses

publish_reachability(addresses, options=None, ifrom=None, callback=None, timeout=None, timeout_callback=None)[source]

Publish alternative addresses where the user can be reached.

Parameters
  • addresses (List[Dict[str, str]]) – A list of dictionaries containing the URI and optional description for each address.

  • options (Optional[Form]) – Optional form of publish options.

stanza = <module 'slixmpp.plugins.xep_0152.stanza' from '/home/docs/checkouts/readthedocs.org/user_builds/slixmpp/checkouts/slix-1.7.1/slixmpp/plugins/xep_0152/stanza.py'>
stop(ifrom=None, callback=None, timeout=None, timeout_callback=None)[source]

Clear existing user activity information to stop notifications.

Stanza elements

Slixmpp: The Slick XMPP Library Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout This file is part of Slixmpp.

See the file LICENSE for copying permission.

class slixmpp.plugins.xep_0152.stanza.Address(xml=None, parent=None)[source]
interfaces = {'desc', '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.

lang_interfaces = {'desc'}

New in version 1.1.2.

name = 'addr'

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

namespace = 'urn:xmpp:reach: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 = 'address'

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 = 'addresses'

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'])
sub_interfaces = {'desc'}

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_0152.stanza.Reachability(xml=None, parent=None)[source]
interfaces = {}

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 = 'reach'

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

namespace = 'urn:xmpp:reach: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 = 'reach'

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_attrib_map = {'address': <class 'slixmpp.plugins.xep_0152.stanza.Address'>, 'addresses': <class 'slixmpp.xmlstream.stanzabase.multifactory.<locals>.Multi'>}

A mapping of the plugin_attrib values of registered plugins to their respective classes.

plugin_iterables = {<class 'slixmpp.plugins.xep_0152.stanza.Address'>}

The set of stanza classes that can be iterated over using the ‘substanzas’ interface. Classes are added to this set when registering a plugin with iterable=True:

register_stanza_plugin(DiscoInfo, DiscoItem, iterable=True)

New in version 1.0-Beta5.

plugin_overrides = {}

A map of interface operations to the overriding functions. For example, after overriding the set operation for the interface body, plugin_overrides would be:

{'set_body': <some function>}
plugin_tag_map = {'{jabber:client}stanza': <class 'slixmpp.xmlstream.stanzabase.multifactory.<locals>.Multi'>, '{urn:xmpp:reach:0}addr': <class 'slixmpp.plugins.xep_0152.stanza.Address'>}

A mapping of root element tag names (in '{namespace}elementname' format) to the plugin classes responsible for them.

«  XEP 0133   ::   Contents   ::   XEP 0153  »