[Bug 20035] Avatar cache reference implementation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 6 22:32:04 CEST 2010


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

--- Comment #13 from Xavier Claessens <xclaesse at gmail.com> 2010-05-06 13:32:04 PDT ---
(In reply to comment #12)
> If it's just the one patch, this looks pretty good. I haven't done a thorough
> review of the refcounting and stuff.
> 
> Would a GFile be a better representation than a string? (I don't know...
> comments welcome.)

I think a GFile is better, changed my branch to replace the filename with a
GFile.

> > +    /* AvatarRetrieved signal is refcounted because we want to keep it
> > +     * connected only when there are contacts waiting for their avatar data */
> 
> This seems like overkill to me. The expensive thing is getting the avatar data
> from the server to the CM; once we've received it, we might as well do
> something with it.

Right, I removed that, making the code simpler.

> Note that we can sometimes retrieve avatars "spontaneously" - whenever an XMPP
> contact's ContactInfo or nickname is downloaded, we get the avatar too - so
> perhaps it would be best to connect to AvatarRetrieved in any client that cares
> about avatar tokens?

The code now support opportunistic cache write, even if we don't have a
TpContact for it. Just have to add a call to
contacts_bind_to_avatar_retrieved() if wanted. I'm not sure we want this
though, in real use cases, empathy will request avatar data anyway, and
tp-logger wants avatar-token to write in logs, but doesn't need avatar data. So
probably better not have too much processes writing the same avatar in cache at
the same time (that's why we are using atomic g_file_set_contents).

> I'm a little alarmed that there's no expiry on the avatar cache; avatars stay
> forever. However, sensible expiry would probably have to be based on keeping a
> record of last access times (or letting the filesystem do it for us, but that
> doesn't work with noatime).

We are writing inside ~/.cache. I think any device with disk contraints should
have a way to purge the whole ~/.cache, or an UI to ask used which cache to
drop, etc... On PC I don't think it will ever take a significate % of you
/home, and it's funny to be able to see very old avatar of some contacts,
sometimes...

> > +      "Avatar MimeType",
> 
> "Avatar MIME type"

fixed.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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