messlidger.group

Module Contents

Classes

Bookmarks

This is instantiated once per BaseSession

MUC

A room, a.k.a. a Multi-User Chat.

Participant

A legacy participant of a legacy group chat.

class messlidger.group.Bookmarks(session)[source]

Bases: slidge.LegacyBookmarks[int, MUC]

This is instantiated once per BaseSession

session: messlidger.session.Session[source]
async by_thread(thread)[source]
Parameters:

thread (maufbapi.types.graphql.Thread)

async legacy_id_to_jid_local_part(i)[source]
Parameters:

i (int)

async jid_local_part_to_legacy_id(local_part)[source]
Parameters:

local_part (str)

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.

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

class messlidger.group.MUC(*a, **k)[source]

Bases: slidge.LegacyMUC[int, str, Participant, int]

A room, a.k.a. a Multi-User Chat.

MUC instances are obtained by calling slidge.group.bookmarks.LegacyBookmarks() on the user’s slidge.core.session.BaseSession.

session: messlidger.session.Session[source]
type[source]
REACTIONS_SINGLE_EMOJI = True[source]
_ALL_INFO_FILLED_ON_STARTUP = True[source]
async get_thread()[source]
async update_info(thread=None)[source]

Fetch information about this group from the legacy network

This is awaited on MUC instantiation, and should be overridden to update the attributes of the group chat, like title, subject, number of participants etc.

To take advantage of the slidge avatar cache, you can check the .avatar property to retrieve the “legacy file ID” of the cached avatar. If there is no change, you should not call slidge.core.mixins.avatar.AvatarMixin.set_avatar() or attempt to modify the :attr:.avatar property.

Parameters:

thread (Optional[maufbapi.types.graphql.Thread])

async fill_participants()[source]

In here, call self.get_participant(), self.get_participant_by_contact(), of self.get_user_participant() to make an initial list of participants.

async fill_history()[source]
class messlidger.group.Participant(muc, nickname=None, is_user=False, is_system=False, role='participant', affiliation='member')[source]

Bases: messlidger.util.ChatterMixin, slidge.LegacyParticipant

A legacy participant of a legacy group chat.

Parameters:
property fb_id[source]