summaryrefslogtreecommitdiff
path: root/src/contacts-linking.vala
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2011-09-09 15:18:00 +0200
committerAlexander Larsson <alexl@redhat.com>2011-09-09 15:20:54 +0200
commit2370fb850fc62621a19475aeb178f2d008456936 (patch)
treebae552faa919d3f8e4efe99093586d9344f07f7d /src/contacts-linking.vala
parentcb48efa20d8717b7eef57819c6c9e91e27663823 (diff)
downloadgnome-contacts-2370fb850fc62621a19475aeb178f2d008456936.tar.gz
Make master-at-join on the contact, not on the persona
Turns out we the old individual doesn't have its personas left at replace time, so we store the master-at-join bit on the contact.
Diffstat (limited to 'src/contacts-linking.vala')
-rw-r--r--src/contacts-linking.vala7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/contacts-linking.vala b/src/contacts-linking.vala
index 00a5120..7acfc08 100644
--- a/src/contacts-linking.vala
+++ b/src/contacts-linking.vala
@@ -406,8 +406,7 @@ namespace Contacts {
public async void link_contacts (Contact main, Contact other) {
// This should not be used as being replaced with the new individual
// instead we should always pick this contact to keep around
- var contact_persona = main.individual.personas.to_array()[0];
- contact_persona.set_data ("contacts-master-at-join", true);
+ main.set_data ("contacts-master-at-join", true);
var main_linkables = get_linkable_attributes_for_individual (main.individual);
var other_linkables = get_linkable_attributes_for_individual (other.individual);
@@ -449,7 +448,7 @@ namespace Contacts {
linkables.add_all (other_linkables);
yield (write_persona as NameDetails).change_full_name (main.display_name);
} catch (GLib.Error e) {
- contact_persona.set_data ("contacts-master-at-join", false);
+ main.set_data ("contacts-master-at-join", false);
warning ("Unable to create new persona when linking: %s\n", e.message);
return;
}
@@ -457,7 +456,7 @@ namespace Contacts {
yield persona_apply_attributes (write_persona, linkables, null);
- contact_persona.set_data ("contacts-master-at-join", false);
+ main.set_data ("contacts-master-at-join", false);
}
public async void unlink_persona (Contact contact, Persona persona_to_unlink) {