GNOME Bugzilla – Bug 640901
Allow it to be determined whether a user Tpf.Persona is in the contact list
Last modified: 2011-02-06 11:10:39 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.
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
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.
Oh, and don't forget to update the NEWS file to mention this bug is fixed.
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(-)