slidge.util.types¶
Typing stuff
Attributes¶
Type of the unique identifier for groups, usually a str or an int, |
Classes¶
Module Contents¶
- slidge.util.types.LegacyGroupIdType¶
Type of the unique identifier for groups, usually a str or an int, but anything hashable should work.
- class slidge.util.types.MessageReference¶
A “message reply”, ie a “quoted message” (XEP-0461)
At the very minimum, the legacy message ID attribute must be set, but to ensure that the quote is displayed in all XMPP clients, the author must also be set (use the string “user” if the slidge user is the author of the referenced message). The body is used as a fallback for XMPP clients that do not support XEP-0461 of that failed to find the referenced message.
- class slidge.util.types.LegacyAttachment¶
A file attachment to a message
At the minimum, one of the
path,steam,dataorurlattribute has to be setTo be used with
LegacyContact.send_files()orLegacyParticipant.send_files()
- class slidge.util.types.MucType¶
The type of group, private, public, anonymous or not.
- GROUP = 0¶
A private group, members-only and non-anonymous, eg a family group.
- CHANNEL = 1¶
A public group, aka an anonymous channel.
- CHANNEL_NON_ANONYMOUS = 2¶
A public group where participants’ legacy IDs are visible to everybody.
- class slidge.util.types.LinkPreview¶
Embedded metadata from XEP-0511.
See <https://ogp.me/>_.
- image: str | pathlib.Path | bytes | None¶
An image representing the link. If it is a string, it should represent a URL to an image.
- class slidge.util.types.UserPreferences¶
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)