slidgnal.group#
Classes#
A legacy participant of a legacy group chat. |
|
A room, a.k.a. a Multi-User Chat. |
|
This is instantiated once per |
Functions#
Module Contents#
- class slidgnal.group.Participant(*a, **kw)[source]#
Bases:
slidgnal.util.AttachmentSenderMixin
,slidge.LegacyParticipant
A legacy participant of a legacy group chat.
- contact: slidgnal.contact.Contact[source]#
- signal_address: aiosignald.generated.JsonAddressv1[source]#
- send_text(body, legacy_msg_id=None, **k)[source]#
Send a text message from this XMPP Entity.
- Parameters:
body (str) – Content of the message
legacy_msg_id – If you want to be able to transport read markers from the gateway user to the legacy network, specify this
when – when the message was sent, for a “delay” tag (XEP-0203)
reply_to – Quote another message (XEP-0461)
hints –
thread –
carbon – (only used if called on a
LegacyContact
) Set this toTrue
if this is actually a message sent to theLegacyContact
by the User. Use this to synchronize outgoing history for legacy official apps.correction – whether this message is a correction or not
correction_event_id – in the case where an ID is associated with the legacy ‘correction event’, specify it here to use it on the XMPP side. If not specified, a random ID will be used.
link_previews – A little of sender (or server, or gateway)-generated previews of URLs linked in the body.
archive_only – (only in groups) Do not send this message to user, but store it in the archive. Meant to be used during
MUC.backfill()
- class slidgnal.group.MUC(*a, **k)[source]#
Bases:
slidge.LegacyMUC
[str
,int
,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
.- session: slidgnal.session.Session[source]#
- async fill_participants()[source]#
This method should yield the list of all members of this group.
Typically, use
participant = self.get_participant()
, self.get_participant_by_contact(), of self.get_user_participant(), and update their affiliation, hats, etc. before yielding them.
- async get_participant_by_contact(c, **kwargs)[source]#
Get a non-anonymous participant.
This is what should be used in non-anonymous groups ideally, to ensure that the Contact jid is associated to this participant
- Parameters:
c – The
LegacyContact
instance corresponding to this contactkwargs – additional parameters for the
Participant
construction (optional)
- Returns:
- Return type:
- async update_info()[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.
- class slidgnal.group.Bookmarks(session)[source]#
Bases:
slidge.LegacyBookmarks
[str
,MUC
]This is instantiated once per
BaseSession
- Parameters:
session (slidge.core.session.BaseSession) –
- session: slidgnal.session.Session[source]#