After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671714 - Fail to add contact to the contact list
Fail to add contact to the contact list
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: Telepathy backend
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
: 672586 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-09 12:58 UTC by Guillaume Desmottes
Modified: 2012-03-26 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
_add_persona_from_contact: always return the persona (3.47 KB, patch)
2012-03-22 14:38 UTC, Guillaume Desmottes
committed Details | Review
create_personas_from_contact_ids: always return all the personas (1.67 KB, patch)
2012-03-22 14:38 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
create_personas_from_contact_ids: always return all the personas (2.61 KB, patch)
2012-03-23 09:37 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2012-03-09 12:58:14 UTC
I'm trying to add a contact using Empathy's 'Add contact' dialog. It calls folks_individual_aggregator_add_persona_from_details() but Folks never do the Telepathy D-Bus calls to actually add the contact.

As you can see in the Folks claim that the persona already exists (which may be true as the dialog displays some info about the contact before actually adding it, so the contact already exists in TP (he has a handle)), set is-in-contact-list to true but doesn't request to actually add it to the contact list.

tp-glib/contacts-DEBUG: contacts_aliases_changed: Contact "debarshi.ray@talkr.im" alias changed from "debarshi.ray@talkr.im" to "debarshi.ray@talkr.im"
empathy-DEBUG: empathy_contact_set_alias: Setting alias for contact debarshi.ray@talkr.im to debarshi.ray@talkr.im
empathy-DEBUG: empathy_contact_set_alias: Setting alias for contact debarshi.ray@talkr.im to debarshi.ray@talkr.im
empathy-DEBUG: empathy_individual_manager_add_from_contact: adding individual from contact debarshi.ray@talkr.im (debarshi.ray@talkr.im)
tp-glib/handles-DEBUG: connection_requested_handles: 1 handles of type 1
tp-glib/handles-DEBUG: tp_connection_get_contact_attributes: 1 handles
tp-glib/handles-DEBUG: tp_connection_get_contact_attributes: - 127
telepathy-DEBUG: tpf-persona-store.vala:1970: Creating persona from contact 'debarshi.ray@talkr.im'
telepathy-DEBUG: tpf-persona-store.vala:2048: Adding persona from contact 'debarshi.ray@talkr.im' (127)
telepathy-DEBUG: tpf-persona-store.vala:2078:     ...already exists.
telepathy-DEBUG: tpf-persona-store.vala:2088:     Setting is-in-contact-list to true
empathy-DEBUG: contact_finalize: finalize: 0x34470e0
telepathy-DEBUG: tpf-persona-store.vala:1551: Ignoring handle 127 (persona: 0x32ad000)
folks-DEBUG: individual-aggregator.vala:1241: Removing Personas:
folks-DEBUG: individual-aggregator.vala:1245:     telepathy:/org/freedesktop/Telepathy/Account/gabble/jabber/guillaume_2edesmottes_40collabora_2eco_2euk0:debarshi.ray@talkr.im (is user: no, IID: jabber:debarshi.ray@talkr.im)
folks-DEBUG: individual-aggregator.vala:1269: Removing Individuals due to removed links:
folks-DEBUG: individual-aggregator.vala:1298: Adding Personas:
folks-DEBUG: individual-aggregator.vala:1314: Relinking Personas:
folks-DEBUG: individual-aggregator.vala:1390: Replacing Individuals due to linking:
telepathy-DEBUG: tpf-persona.vala:1000: Destroying Tpf.Persona 'telepathy:/org/freedesktop/Telepathy/Account/gabble/jabber/guillaume_2edesmottes_40collabora_2eco_2euk0:debarshi.ray@talkr.im': 0x32ad000
Comment 1 Guillaume Desmottes 2012-03-21 14:53:21 UTC
(In reply to comment #0)
> As you can see in the Folks claim that the persona already exists (which may be
> true as the dialog displays some info about the contact before actually adding
> it, so the contact already exists in TP (he has a handle)), set
> is-in-contact-list to true but doesn't request to actually add it to the
> contact list.

Am I mising something here? Is Folks supposed to be do the request later or...?
Comment 2 Guillaume Desmottes 2012-03-22 10:19:43 UTC
*** Bug 672586 has been marked as a duplicate of this bug. ***
Comment 3 Guillaume Desmottes 2012-03-22 14:38:45 UTC
Created attachment 210346 [details] [review]
_add_persona_from_contact: always return the persona

In some case we may be interested by using the persona even if it was already
existing.
Comment 4 Guillaume Desmottes 2012-03-22 14:38:51 UTC
Created attachment 210347 [details] [review]
create_personas_from_contact_ids: always return all the personas

We always want to try adding the persona to Telepathy, even if it was already
existing in Folks because, for example, we look for the details of this
contact before adding it.
Comment 5 Philip Withnall 2012-03-22 23:18:58 UTC
Review of attachment 210346 [details] [review]:

Looks fine to me, but it might make sense to rename “_add_persona_from_contact” to “_ensure_persona_from_contact” now that its behaviour has changed. Please commit once you’ve made that change.
Comment 6 Philip Withnall 2012-03-22 23:20:15 UTC
Review of attachment 210347 [details] [review]:

Also looks fine, but again it might make sense to rename “_create_personas_from_contact_ids” to “_ensure_personas_from_contact_ids”. Once you’ve done that, *and added an entry to NEWS* in the commit, please push to master. Thanks!
Comment 7 Guillaume Desmottes 2012-03-23 09:33:38 UTC
(In reply to comment #5)
> Review of attachment 210346 [details] [review]:
> 
> Looks fine to me, but it might make sense to rename “_add_persona_from_contact”
> to “_ensure_persona_from_contact” now that its behaviour has changed. Please
> commit once you’ve made that change.

We already have   internal Tpf.Persona? _ensure_persona_from_contact (Contact contact)
Comment 8 Guillaume Desmottes 2012-03-23 09:37:15 UTC
Created attachment 210400 [details] [review]
create_personas_from_contact_ids: always return all the personas

We always want to try adding the persona to Telepathy, even if it was already
existing in Folks because, for example, we look for the details of this
contact before adding it.
Comment 9 Philip Withnall 2012-03-23 10:25:09 UTC
Review of attachment 210400 [details] [review]:

Great!
Comment 10 Guillaume Desmottes 2012-03-23 10:26:36 UTC
Attachment 210346 [details] pushed as 8f26cd5 - _add_persona_from_contact: always return the persona
Attachment 210400 [details] pushed as 7df672d - create_personas_from_contact_ids: always return all the personas
Comment 11 Debarshi Ray 2012-03-26 14:06:08 UTC
*** Bug 672586 has been marked as a duplicate of this bug. ***