key-file: Yield when setting properties on new personas
authorPhilip Withnall <philip@tecnocode.co.uk>
Fri, 2 Sep 2011 18:27:33 +0000 (19:27 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Fri, 2 Sep 2011 18:28:34 +0000 (19:28 +0100)
This fixes the libsocialweb aggregation test.

Helps: bgo#657510

backends/key-file/kf-persona-store.vala

index a6fb09e..d4d075b 100644 (file)
@@ -352,10 +352,24 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
        * key file */
       Persona persona = new Kf.Persona (this._key_file, persona_id, this);
       this._personas.set (persona.iid, persona);
-      if (im_addresses != null)
-        persona.im_addresses = im_addresses;
-      if (web_service_addresses != null)
-        persona.web_service_addresses = web_service_addresses;
+
+      try
+        {
+          if (im_addresses != null)
+            {
+              yield persona.change_im_addresses (im_addresses);
+            }
+          if (web_service_addresses != null)
+            {
+              yield persona.change_web_service_addresses (
+                  web_service_addresses);
+            }
+        }
+      catch (PropertyError e)
+        {
+          /* This should never happen. */
+          throw new PersonaStoreError.CREATE_FAILED (e.message);
+        }
 
       /* FIXME: GroupDetails.ChangeReason is not the right enum to use here */
       var personas = new HashSet<Persona> ();