slidge.core#

Submodules#

Package Contents#

Classes#

class slidge.core.PubSubComponent(*a, **kw)[source]#

Bases: slixmpp.plugins.base.BasePlugin

xmpp :slixmpp.ComponentXMPP#
name = pubsub#
description = Pubsub component#
dependencies#
default_config#
component_name :str#
plugin_init()#

Initialize plugin state, such as registering event handlers.

async _on_got_online(p)#
Parameters

p (slixmpp.Presence) –

broadcast_vcard_event(from_, to)#
static _get_authorized_item(store, stanza)#
Parameters
  • store (dict[slixmpp.JID, PepItemType]) –

  • stanza (Union[slixmpp.Iq, slixmpp.Presence]) –

Return type

PepItemType

_get_authorized_avatar(stanza)#
Parameters

stanza (Union[slixmpp.Iq, slixmpp.Presence]) –

_get_authorized_nick(stanza)#
Parameters

stanza (Union[slixmpp.Iq, slixmpp.Presence]) –

async _get_avatar_data(iq)#
Parameters

iq (slixmpp.Iq) –

async _get_avatar_metadata(iq)#
Parameters

iq (slixmpp.Iq) –

async _get_vcard(iq)#
Parameters

iq (slixmpp.Iq) –

static _reply_with_payload(iq, payload, id_, namespace=None)#
Parameters
  • iq (slixmpp.Iq) –

  • payload (Union[slixmpp.plugins.xep_0084.MetaData, slixmpp.plugins.xep_0084.Data, slidge.util.xep_0292.stanza.VCard4]) –

  • id_ (str) –

  • namespace (Optional[str]) –

_broadcast(data, from_, to=None, **kwargs)#
Parameters
  • from_ (slixmpp.types.JidStr) –

  • to (slixmpp.types.OptJidStr) –

async set_avatar(jid, avatar=None, restrict_to=None)#
Parameters
  • jid (slixmpp.types.JidStr) –

  • avatar (Optional[slidge.util.types.AvatarType]) –

  • restrict_to (slixmpp.types.OptJidStr) –

set_nick(jid, nick=None, restrict_to=None)#
Parameters
  • jid (slixmpp.types.JidStr) –

  • nick (Optional[str]) –

  • restrict_to (slixmpp.types.OptJidStr) –