slidge.plugins.signal.group
#
Module Contents#
Classes#
Abstract base class for generic types. |
|
Abstract base class for generic types. |
Functions#
- class slidge.plugins.signal.group.Participant(muc, nickname=None, is_user=False, is_system=False)[source]#
Bases:
slidge.plugins.signal.util.AttachmentSenderMixin
,slidge.LegacyParticipant
- Parameters:
muc (slidge.core.muc.room.LegacyMUC) –
nickname (Optional[str]) –
- signal_address: aiosignald.generated.JsonAddressv1[source]#
- send_text(body, legacy_msg_id=None, **k)[source]#
Transmit a message from the entity to the user
- 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 in 1:1) Reflect a message sent to this
Contact
by the user. Use this to synchronize outgoing history for legacy official apps.correction – whether this message is a correction or not
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 slidge.plugins.signal.group.MUC(*a, **k)[source]#
Bases:
slidge.LegacyMUC
[str
,int
,Participant
,str
]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
- 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 get_participant_by_contact(contact)[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:
- class slidge.plugins.signal.group.Bookmarks(session)[source]#
Bases:
slidge.LegacyBookmarks
[str
,MUC
]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) –
- 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()