slidge.core.gateway.presence#

Module Contents#

Classes#

PresenceHandlerMixin

Slixmpp's basic XMPP server component.

Attributes#

log

exception slidge.core.gateway.presence._IsDirectedAtComponent(session)[source]#

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

session (slidge.core.session.BaseSession) –

class slidge.core.gateway.presence.PresenceHandlerMixin(jid, secret, host=None, port=None, plugin_config=None, plugin_whitelist=None, use_jc_ns=False)[source]#

Bases: slixmpp.ComponentXMPP

Slixmpp’s basic XMPP server component.

Use only for good, not for evil.

Parameters:
  • jid – The JID of the component.

  • secret – The secret or password for the component.

  • host – The server accepting the component.

  • port – The port used to connect to the server.

  • plugin_config – A dictionary of plugin configurations.

  • plugin_whitelist – A list of approved plugins that will be loaded when calling register_plugins().

  • use_jc_ns – Indicates if the 'jabber:client' namespace should be used instead of the standard 'jabber:component:accept' namespace. Defaults to False.

abstract get_session_from_stanza(s)[source]#
Return type:

slidge.core.session.BaseSession

async __get_contact(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async __get_session(p)[source]#
Parameters:

p (slixmpp.Presence) –

async _handle_subscribe(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_unsubscribe(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_subscribed(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_unsubscribed(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_probe(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_new_subscription(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

async _handle_removed_subscription(pres)[source]#
Parameters:

pres (slixmpp.Presence) –

slidge.core.gateway.presence.log[source]#