telepathy: Preserve Tpf.Persona avatars from the cache for online contacts
authorPhilip Withnall <philip@tecnocode.co.uk>
Fri, 22 Jun 2012 18:17:42 +0000 (19:17 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Thu, 19 Jul 2012 03:53:27 +0000 (04:53 +0100)
commitc2338c651edd3fcdc3ef28c94d87351b8c6bae27
tree3a958251f61b6f94623f53a35c9b9efc7c5cb727
parent36ecd01a58b952c40c985166aa74ededda7fcefc
telepathy: Preserve Tpf.Persona avatars from the cache for online contacts

This is a fairly hacky way of fixing the problem in bug #660128: maintaining
a map of IIDs to avatar files for all personas in the Telepathy backend, and
referring to it in case Telepathy doesn’t know the current avatar for a
TpContact. This can happen if that contact is currently offline while we’re
online, for example. This allows use of the avatars cached from last time
contacts were online, even though those contacts are now offline.

A more comprehensive fix, which I would have implemented if I hadn’t just got
my degree classification and weren’t just heading out to celebrate, would
involve rearchitecting the caching of the Telepathy backend so that the
Tpf.Personas weren’t destroyed and re-created whenever the backend went
offline/online; instead, they would have their properties updated from the
cache/online contact list. This would eliminate spurious personas-changed
signals, unify the code implementing the different properties (currently it’s
split between the properties and separate implementations in
Tpf.Persona.from_cache()), and allow property values to persist from offline
to online without the need for hacks like this.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=660128
backends/telepathy/lib/tpf-persona-store.vala
backends/telepathy/lib/tpf-persona.vala