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 640901 - Allow it to be determined whether a user Tpf.Persona is in the contact list
Allow it to be determined whether a user Tpf.Persona is in the contact list
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: Telepathy backend
git master
Other All
: Normal enhancement
: folks-0.3.5
Assigned To: folks-maint
folks-maint
Depends on:
Blocks: 637151
 
 
Reported: 2011-01-29 16:20 UTC by Philip Withnall
Modified: 2011-02-06 11:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow to determine whether a Tpf.Persona's in the contact list (6.27 KB, patch)
2011-01-29 16:23 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2011-01-29 16:20:35 UTC
Branch coming up to expose API to allow clients to determine whether a Tpf.Persona with is-user == true is in the user's contact list. This is necessary to fix bug #637151.
Comment 1 Philip Withnall 2011-01-29 16:23:01 UTC
Created attachment 179599 [details] [review]
Allow to determine whether a Tpf.Persona's in the contact list

http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/640901-is-in-contact-list
Comment 2 Travis Reitter 2011-02-02 06:58:59 UTC
Review of attachment 179599 [details] [review]:

+              /* Update that the persona has been seen in the contact list,
+               * since we might first see a persona because it's the
+               * self-handle, but now also see it in the contact list. */

I read this a few times, but I'm still not quite sure what it means. Perhaps splitting it into a few sentences would help?

+          /* Update whether the persona has been seen in the contact list, since
+           * we might first see a persona because it's the self-handle, but
+           * later also see it in the contact list. */

Same here (though to a lesser extent).

+          debug ("    Setting is-in-contact-list to %s",
+              from_contact_list ? "true" : "false");

With FOLKS_DEBUG=all or FOLKS_DEBUG=telepathy, we'll get this for every Persona that's created, which might be a bit of over-kill. Maybe we could only print it if is-in-contact-list == false (since that's a bit more noteworthy). But I'll leave it up to your choice.

+              debug ("    Setting is-in-contact-list to true");

Similar as above, though we shouldn't be reaching this branch very often (if we are, there may be some optimization to do to avoid re-adding Personas).

Feel free to commit after making these changes.
Comment 3 Travis Reitter 2011-02-02 16:24:07 UTC
Oh, and don't forget to update the NEWS file to mention this bug is fixed.
Comment 4 Philip Withnall 2011-02-06 11:10:29 UTC
We need to make a release before this can be used to fix bug #637151.

Committed with the above changes. Hopefully the comments are now understandable. :-)

commit 05cca833976054240e62b4d0df00954059440580
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Dec 17 18:36:45 2010 +0000

    Bug 640901 — Allow to determine whether a Tpf.Persona's in the contact list
    
    Add Tpf.Persona.is-in-contact-list, which is true iff the persona's in the
    user's contact list. Closes: bgo#640901

 NEWS                                          |    3 +
 backends/telepathy/lib/tpf-persona-store.vala |   66 +++++++++++++++++++++----
 backends/telepathy/lib/tpf-persona.vala       |   12 +++++
 3 files changed, 71 insertions(+), 10 deletions(-)