telepathy: Fix notification of is-favourite changes
authorPhilip Withnall <philip@tecnocode.co.uk>
Mon, 26 Mar 2012 15:21:56 +0000 (16:21 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Tue, 17 Apr 2012 10:58:13 +0000 (11:58 +0100)
This ensures that the UI reflects errors in changing the is-favourite status
of a Tpf.Persona, rather than just blindly assuming they succeed.

backends/telepathy/lib/tpf-persona.vala

index eae6551..b8543af 100644 (file)
@@ -338,12 +338,17 @@ public class Tpf.Persona : Folks.Persona,
               is_favourite);
         }
 
-      this._is_favourite = is_favourite;
-      this.notify_property ("is-favourite");
+      /* The change will be notified when we receive changes from the store. */
     }
 
+  /* Note: Only ever called by Tpf.PersonaStore. */
   internal void _set_is_favourite (bool is_favourite)
     {
+      if (this._is_favourite == is_favourite)
+        {
+          return;
+        }
+
       this._is_favourite = is_favourite;
       this.notify_property ("is-favourite");
     }