Only warn about unknown personas if the account is already connected
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 30 Jun 2010 10:47:42 +0000 (11:47 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 30 Jun 2010 10:48:06 +0000 (11:48 +0100)
This fixes spew of "unknown persona in favourites list" messages on startup.

backends/telepathy/tpf-persona-store.vala

index 84d6a85..263ca32 100644 (file)
@@ -190,14 +190,20 @@ public class Tpf.PersonaStore : Folks.PersonaStore
           else
             this.favourite_handles.remove (h);
 
-          if (p == null)
+          /* If the persona isn't in the handle_persona_map yet, it's most
+           * likely because the account hasn't connected yet (and we haven't
+           * received the roster). If there are already entries in
+           * handle_persona_map, the account *is* connected and we should
+           * warn about the unknown persona. */
+          if (p == null && this.handle_persona_map.size > 0)
             {
               warning ("unknown persona '%s' in favourites list", ids[i]);
               continue;
             }
 
           /* Mark or unmark the persona as a favourite */
-          p.is_favourite = add;
+          if (p != null)
+            p.is_favourite = add;
         }
     }