slidge.core.mixins.message
#
Module Contents#
Classes#
Attributes#
- class slidge.core.mixins.message.ChatStateMixin[source]#
Bases:
slidge.core.mixins.message_maker.MessageMaker
- composing(**kwargs)[source]#
Send a “composing” (ie “typing notification”) chat state (XEP-0085) from this contact to the user.
- paused(**kwargs)[source]#
Send a “paused” (ie “typing paused notification”) chat state (XEP-0085) from this contact to the user.
- class slidge.core.mixins.message.MarkerMixin[source]#
Bases:
slidge.core.mixins.message_maker.MessageMaker
- _make_marker(legacy_msg_id, marker, carbon=False)[source]#
- Parameters:
legacy_msg_id (slidge.util.types.LegacyMessageType) –
marker (slidge.util.types.Marker) –
- ack(legacy_msg_id, **kwargs)[source]#
Send an “acknowledged” message marker (XEP-0333) from this contact to the user.
- Parameters:
legacy_msg_id (slidge.util.types.LegacyMessageType) – The message this marker refers to
- class slidge.core.mixins.message.ContentMessageMixin[source]#
Bases:
slidge.core.mixins.attachment.AttachmentMixin
- __default_hints(hints=None)[source]#
- Parameters:
hints (Optional[Iterable[slidge.util.types.ProcessingHint]]) –
- __replace_id(legacy_msg_id)[source]#
- Parameters:
legacy_msg_id (slidge.util.types.LegacyMessageType) –
- send_text(body, legacy_msg_id=None, *, when=None, reply_to=None, thread=None, hints=None, carbon=False, archive_only=False, correction=False, **send_kwargs)[source]#
Transmit a message from the entity to the user
- Parameters:
body (str) – Content of the message
legacy_msg_id (Optional[slidge.util.types.LegacyMessageType]) – If you want to be able to transport read markers from the gateway user to the legacy network, specify this
when (Optional[datetime.datetime]) – when the message was sent, for a “delay” tag (XEP-0203)
reply_to (Optional[slidge.util.types.MessageReference]) – Quote another message (XEP-0461)
hints (Optional[Iterable[slidge.util.types.ProcessingHint]]) –
thread (Optional[slidge.util.types.LegacyThreadType]) –
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()
- correct(legacy_msg_id, new_text, *, when=None, reply_to=None, thread=None, hints=None, carbon=False, archive_only=False, **send_kwargs)[source]#
Call this when a legacy contact has modified his last message content.
Uses last message correction (XEP-0308)
- Parameters:
new_text (str) – New content of the message
legacy_msg_id (slidge.util.types.LegacyMessageType) – The legacy message ID of the message to correct
when (Optional[datetime.datetime]) – when the message was sent, for a “delay” tag (XEP-0203)
reply_to (Optional[slidge.util.types.MessageReference]) – Quote another message (XEP-0461)
hints (Optional[Iterable[slidge.util.types.ProcessingHint]]) –
thread (Optional[slidge.util.types.LegacyThreadType]) –
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.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()
- react(legacy_msg_id, emojis=(), thread=None, **kwargs)[source]#
Call this when a legacy contact reacts to a message
- Parameters:
legacy_msg_id (slidge.util.types.LegacyMessageType) – The message which the reaction refers to.
emojis (Iterable[str]) – An iterable of emojis used as reactions
thread (Optional[slidge.util.types.LegacyThreadType]) –
- class slidge.core.mixins.message.CarbonMessageMixin[source]#
Bases:
ContentMessageMixin
,MarkerMixin
- class slidge.core.mixins.message.MessageMixin[source]#
Bases:
ChatStateMixin
,MarkerMixin
,ContentMessageMixin
- class slidge.core.mixins.message.MessageCarbonMixin[source]#
Bases:
ChatStateMixin
,CarbonMessageMixin