summaryrefslogtreecommitdiff
path: root/backends/key-file
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-08-11 13:57:25 +0200
committerPhilip Withnall <philip@tecnocode.co.uk>2011-08-29 23:13:33 +0100
commit659d0c0b1dfb7123ee14c9cefe53696dd4dfb951 (patch)
tree3cd8c9249e81f061163c97faf2f152412ce9f64d /backends/key-file
parent9ce804c7b3f712eb43121c1ef9cf17e0cf75bcc8 (diff)
key-file: Allow empty Kf.Personas to be added to the persona store
This is necessary for the tests for bgo#653777. It removes the error which would previously be thrown when trying to add a persona to Kf.PersonaStore with no properties. Helps: bgo#653777
Diffstat (limited to 'backends/key-file')
-rw-r--r--backends/key-file/kf-persona-store.vala18
1 files changed, 2 insertions, 16 deletions
diff --git a/backends/key-file/kf-persona-store.vala b/backends/key-file/kf-persona-store.vala
index 2c4698ea..a6fb09e6 100644
--- a/backends/key-file/kf-persona-store.vala
+++ b/backends/key-file/kf-persona-store.vala
@@ -333,20 +333,6 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
= val2 != null
? (MultiMap<string, WebServiceFieldDetails>) val2.get_object ()
: null;
- uint im_addresses_size = (im_addresses == null)
- ? 0 : im_addresses.size;
- uint web_service_addresses_size = (web_service_addresses == null)
- ? 0 : web_service_addresses.size;
-
- if (im_addresses_size + web_service_addresses_size == 0)
- {
- throw new PersonaStoreError.INVALID_ARGUMENT (
- /* Translators: the first two parameters are identifiers for the
- * persona store. The third is a pointer address. Do not translate
- * "im-addresses", as it's an object property name. */
- _("Persona store (%s, %s) requires the following details:\n im-addresses (provided: '%p')"),
- this.type_id, this.id, im_addresses);
- }
debug ("Adding Persona from details.");
@@ -366,9 +352,9 @@ 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_size > 0)
+ if (im_addresses != null)
persona.im_addresses = im_addresses;
- if (web_service_addresses_size > 0)
+ if (web_service_addresses != null)
persona.web_service_addresses = web_service_addresses;
/* FIXME: GroupDetails.ChangeReason is not the right enum to use here */