XEP-0106: Gateway interaction#

class slixmpp.plugins.xep_0100.XEP_0100(xmpp, config=None)[source]#

XEP-0100: Gateway interaction

Does not cover the deprecated Agent Information and ‘jabber:iq:gateway’ protocols

Events registered by this plugin:

  • legacy_login: Jabber user got online or just registered

  • legacy_logout: Jabber user got offline or just unregistered

  • legacy_presence_unavailable: Jabber user sent an unavailable presence to a legacy contact

  • gateway_message: Jabber user sent a direct message to the gateway component

  • legacy_message: Jabber user sent a message to the legacy network

Plugin Parameters:

  • component_name: (str) Name of the entity

  • type: (str) Type of the gateway identity. Should be the name of the legacy service

  • needs_registration: (bool) If set to True, messages received from unregistered users will not be transmitted to the legacy service

API:

  • legacy_contact_add(jid, node, ifrom: JID, args: JID): Add contact on the legacy service. Should raise LegacyError if anything goes wrong in the process. ifrom is the gateway user’s JID and args is the legacy contact’s JID.

  • legacy_contact_remove(jid, node, ifrom: JID, args: JID): Remove a contact.

default_config: ClassVar[Dict[str, Any]] = {'component_name': 'SliXMPP gateway', 'needs_registration': True, 'type': 'xmpp'}#

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’].

dependencies: ClassVar[Set[str]] = {'xep_0030', 'xep_0077'}#

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.

description: str = 'XEP-0100: Gateway interaction'#

A longer name for the plugin, describing its purpose. For example, a plugin for XEP-0030 would use ‘Service Discovery’ as its description value.

name: str = 'xep_0100'#

A short name for the plugin based on the implemented specification. For example, a plugin for XEP-0030 would use ‘xep_0030’.

transform_legacy_message(jabber_user_jid, legacy_contact_id, body, mtype=None)[source]#

Transform a legacy message to an XMPP message