slidge.core.mixins
#
Mixins
Package Contents#
Classes#
Mixin for XMPP entities that have avatars that represent them. |
- class slidge.core.mixins.AvatarMixin#
Mixin for XMPP entities that have avatars that represent them.
Both
slidge.LegacyContact
andslidge.LegacyMUC
useAvatarMixin
.- property avatar_id: slidge.util.types.AvatarIdType | None#
The unique ID of this entity’s avatar.
- Return type:
Optional[slidge.util.types.AvatarIdType]
- property avatar: slidge.util.types.AvatarIdType | None#
This property can be used to set the avatar, but
set_avatar()
should be preferred because you can provide a unique ID for the avatar for efficient caching. Setting this is OKish in case the avatar type is a URL or a local path that can act as a legacy ID.Python’s
property
is abused here to maintain backwards compatibility, but when getting it you actually get the avatar legacy ID.- Return type:
Optional[slidge.util.types.AvatarIdType]
- async set_avatar(a, avatar_unique_id=None, blocking=False, cancel=True)#
Set an avatar for this entity
- Parameters:
a (Optional[slidge.util.types.AvatarType]) –
avatar_unique_id (Optional[slidge.util.types.LegacyFileIdType]) –
blocking –
cancel –
- Return type:
None