:py:mod:`slidge.core.mixins`
============================

.. py:module:: slidge.core.mixins

.. autoapi-nested-parse::

   Mixins



Package Contents
----------------

Classes
~~~~~~~

.. autoapisummary::

   slidge.core.mixins.AvatarMixin




.. py:class:: AvatarMixin


   Mixin for XMPP entities that have avatars that represent them.

   Both :py:class:`slidge.LegacyContact` and :py:class:`slidge.LegacyMUC` use
   :py:class:`.AvatarMixin`.

   .. py:property:: avatar_id
      :type: Optional[slidge.util.types.AvatarIdType]

      The unique ID of this entity's avatar.


   .. py:property:: avatar
      :type: Optional[slidge.util.types.AvatarIdType]

      This property can be used to set the avatar, but
      :py:meth:`~.AvatarMixin.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.


   .. py:method:: set_avatar(a, avatar_unique_id = None, blocking=False, cancel=True)
      :async:

      Set an avatar for this entity

      :param a:
      :param avatar_unique_id:
      :param blocking:
      :param cancel:



