[telepathy-mission-control/master] McdConnection: bugfix: if the account has a stored avatar (or lack thereof), take it, unless we are changing it

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Jun 3 04:11:35 PDT 2009


* Account exists on server with stored avatar A (which might be an avatar,
  or the absence of an avatar)
* MC is not connected
* Another client (say, Pidgin) connects and changes avatar to B (which
  might be an avatar, or the absence of an avatar)
* Pidgin disconnects
* MC signs in

Desired result: MC sets the Account.Interface.Avatar.Avatar property to B
Actual result before this bugfix: MC still thinks the desired avatar is A
---
 src/mcd-connection.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 123ec4c..765644f 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -728,8 +728,13 @@ avatars_request_tokens_cb (TpConnection *proxy, GHashTable *tokens,
 
     self_handle = tp_connection_get_self_handle (proxy);
     token = g_hash_table_lookup (tokens, GUINT_TO_POINTER (self_handle));
+
     if (token)
-	return;
+    {
+        /* act as though the avatar had changed to this */
+        on_avatar_updated (proxy, self_handle, token, priv, weak_object);
+        return;
+    }
 
     _mcd_account_get_avatar (priv->account, &avatar, &mime_type);
     if (avatar)
-- 
1.5.6.5




More information about the telepathy-commits mailing list