From e55b4a34533ec95287a2876467016f0075651fca Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Thu, 15 Aug 2013 13:13:17 +0200 Subject: [PATCH 2/2] Do not update when we receive empty nodes from wocky. Facebook send empty "updates" around one minute after initial grab. This ends up updating the cache with empty name and photo which leaves the roster with only the facebook id. --- src/presence-cache.c | 2 ++ src/roster.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/presence-cache.c b/src/presence-cache.c index f7d02ee..fda23a5 100644 --- a/src/presence-cache.c +++ b/src/presence-cache.c @@ -901,6 +901,8 @@ _grab_avatar_sha1 (GabblePresenceCache *cache, /* "" means we know there is no avatar. NULL means we don't know what is the * avatar. In this case, there is a node. */ + if (sha1 == NULL && NULL != presence->avatar_sha1) + sha1 = presence->avatar_sha1; if (sha1 == NULL) sha1 = ""; diff --git a/src/roster.c b/src/roster.c index d2cc4da..d307276 100644 --- a/src/roster.c +++ b/src/roster.c @@ -545,7 +545,8 @@ _gabble_roster_item_update (GabbleRoster *roster, else name = wocky_node_get_attribute (node, "name"); - if (tp_strdiff (item->name, name)) + if (tp_strdiff (item->name, name) + && (NULL != name) && tp_strdiff(name, "")) { g_free (item->name); item->name = g_strdup (name); -- 1.8.4.rc2