[Bug 33409] Give avatar URI on Account

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 23 14:04:10 CEST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=33409

--- Comment #2 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
Complexity: MC currently uses the same filename every time. To indicate
*changes* in a useful way, I think we'd have to do something similar to
contacts' avatars: have something in the signal that's guaranteed to change
every time. It can either be a unique URI per change, or a separate
change-indicator. We can't use the avatar token, because if you set your avatar
while online, MC doesn't know what token is going to be used; it'd have to be a
sequence number or something.

We could do something like this:

    Account.AvatarURI: s, read-only
        A file:/// URI pointing to the account's avatar.

        | We use a file:/// URI rather than a filename because
        | Unix paths are not guaranteed to be UTF-8, or any consistent
        | encoding at all.

        The URI must change every time the bytes of the avatar are changed
        (for instance, an implementation may copy avatar data into a
        file whose name includes a sequence number). Other than that, its
        structure and location are implementation-defined.

        Change notification is via AccountPropertyChanged.

    Account.AvatarMIMEType: s, read-only
        The MIME type of the file at AvatarURI. This property
        SHOULD appear in the same AccountPropertyChanged signal
        as Account.AvatarURI.

        Change notification is via AccountPropertyChanged.

    Account.SetAvatar(ay: Bytes, s: MIME_Type)
        If the account is currently connected and supports avatars,
        attempt to change its avatar immediately.
        If not, remember that the change has occurred, and
        attempt to make the change next time the account becomes
        connected.

and have the URIs be something like
file://${XDG_DATA_HOME}/telepathy/mission-control/salut-local_xmpp-account0.${SEQ}.avatar,
where ${XDG_DATA_HOME} is what you'd expect, and ${SEQ} is a 32-bit counter
(with wraparound if you change it far too often)? We'd store the sequence
number in the account data as a pseudo-property, and construct the URI at .

We can't just put it in the avatar cache, because on protocols like Salut where
avatars are transient, this is really configuration.

Open questions:

* should SetAvatar wait for Conn.I.Avatars.SetAvatar, if connected,
  before returning?
* if Conn.I.Avatars.SetAvatar fails, should we still update AvatarURI and
  AvatarMIMEType, so we'll have another try next time we connect?
  Or should we change them when we start the attempt, and change them
  *back* if it fails?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list