matteridge.group
¶
Module Contents¶
Classes¶
This is instantiated once per |
|
A legacy participant of a legacy group chat. |
|
A room, a.k.a. a Multi-User Chat. |
- class matteridge.group.Bookmarks(*a, **k)[source]¶
Bases:
slidge.LegacyBookmarks
[str
,MUC
]This is instantiated once per
BaseSession
- session: matteridge.session.Session[source]¶
- class matteridge.group.Participant(muc, nickname=None, is_user=False, is_system=False, role='participant', affiliation='member')[source]¶
Bases:
matteridge.util.UserMixin
,slidge.LegacyParticipant
A legacy participant of a legacy group chat.
- Parameters:
nickname (Optional[str])
role (slidge.util.types.MucRole)
affiliation (slidge.util.types.MucAffiliation)
- contact: matteridge.contact.Contact[source]¶
- class matteridge.group.MUC(session, legacy_id, jid)[source]¶
Bases:
slidge.LegacyMUC
[str
,str
,Participant
,str
]A room, a.k.a. a Multi-User Chat.
MUC instances are obtained by calling
slidge.group.bookmarks.LegacyBookmarks()
on the user’sslidge.core.session.BaseSession
.- Parameters:
session (slidge.core.session.BaseSession)
legacy_id (slidge.util.types.LegacyGroupIdType)
jid (slixmpp.JID)
- session: matteridge.session.Session[source]¶
- async update_info(channel=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:
channel (Optional[mattermost_api_reference_client.models.Channel])
- 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 backfill(oldest_message_id=None, oldest_message_date=None)[source]¶
Override this if the legacy network provide server-side archive. In it, send history messages using
self.get_participant().send*
, with thearchive_only=True
kwarg.You only need to fetch messages older than
oldest_message_id
.- Parameters:
oldest_message_id (Optional[str]) – The oldest message ID already present in the archive
oldest_message_date (Optional[datetime.datetime]) – The oldest message date already present in the archive