slidge.core.muc.bookmarks#

Module Contents#

Classes#

LegacyBookmarks

Abstract base class for generic types.

class slidge.core.muc.bookmarks.LegacyBookmarks(session)[source]#

Bases: Generic[slidge.util.types.LegacyGroupIdType, slidge.util.types.LegacyMUCType], slidge.core.mixins.lock.NamedLockMixin

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
Parameters:

session (slidge.core.session.BaseSession) –

property user_nick[source]#
__iter__()[source]#
__repr__()[source]#

Return repr(self).

async __finish_init_muc(legacy_id, jid)[source]#
Parameters:
  • legacy_id (slidge.util.types.LegacyGroupIdType) –

  • jid (slixmpp.JID) –

async legacy_id_to_jid_local_part(legacy_id)[source]#
Parameters:

legacy_id (slidge.util.types.LegacyGroupIdType) –

async jid_local_part_to_legacy_id(local_part)[source]#
Parameters:

local_part (str) –

async by_jid(jid)[source]#
Parameters:

jid (slixmpp.JID) –

Return type:

slidge.util.types.LegacyMUCType

async by_legacy_id(legacy_id)[source]#
Parameters:

legacy_id (slidge.util.types.LegacyGroupIdType) –

Return type:

slidge.util.types.LegacyMUCType

async fill()[source]#

Establish a user’s known groups.

This has to be overridden in plugins with group support and at the minimum, this should await self.by_legacy_id(group_id) for all the groups a user is part of.

Ideally, set the group subject, friendly, number, etc. in this method

Slidge internals will call this on successful BaseSession.login()