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 678696 - Add API for EDS Google system groups
Add API for EDS Google system groups
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: e-d-s backend
git master
Other All
: Normal enhancement
: gnome-2.32
Assigned To: folks-maint
folks-maint
Depends on:
Blocks: 676383
 
 
Reported: 2012-06-24 10:53 UTC by Philip Withnall
Modified: 2012-07-16 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add Edsf.Persona.in_google_personal_group (3.66 KB, patch)
2012-06-24 10:55 UTC, Philip Withnall
committed Details | Review
avatar fetcher - WARNING: servers are going to hate you (2.84 KB, text/x-csrc)
2012-06-25 07:45 UTC, Guillaume Desmottes
  Details

Description Philip Withnall 2012-06-24 10:53:30 UTC
As needed for bug #676383.
Comment 1 Philip Withnall 2012-06-24 10:55:21 UTC
Created attachment 217107 [details] [review]
Add Edsf.Persona.in_google_personal_group

https://www.gitorious.org/folks/folks/commits/676383-eds-google-personal-group

Here’s a patch to expose the “My Contacts” system group from Google Contacts on EDS personas.

For simplicity, I chose to implement it as a boolean property, rather than a set of the IDs of the system groups the contact’s in. If anyone thinks the latter idea is more future-proof, I’m happy to change the patch; but I think that all of the system groups except “My Contacts” are a waste of time anyway and don’t seem to be used for anything.
Comment 2 Philip Withnall 2012-06-24 10:59:49 UTC
I should mention that this has a runtime dependency on EDS commit 1cfc48f58873ee448f2bb7853c9d3c0f0f48caab which will be in EDS 3.5.3.
Comment 3 Philip Withnall 2012-06-24 11:01:13 UTC
Bah, and once more I’ve forgotten to update NEWS with the bug number. That should be done before this is committed.
Comment 4 Guillaume Desmottes 2012-06-25 07:45:28 UTC
Created attachment 217165 [details]
avatar fetcher - WARNING: servers are going to hate you

I hacked this simple app manually fetching avatars of all my TP contacts in order to populate my cache and test this patch.

Unfortunatelly it doesn't seem to work:
- Start Empathy and display offline contacts
- Your offline Facebook contacts won't have an avatar
- Run my script and freeze your laptop for a short while
- All Facebook contacts now have an avatar
- Restart Empathy
- Their avatar is gone :(
Comment 5 Guillaume Desmottes 2012-06-25 07:50:26 UTC
Comment on attachment 217165 [details]
avatar fetcher - WARNING: servers are going to hate you

Sorry this was meant for bug #660128
Comment 6 Jeremy Whiting 2012-06-25 22:46:58 UTC
How exactly do you test this?  Are contacts from eds shown in empathy somehow? Only if they are linked to an im contact?  Or are you just testing in folks-inspect?
Comment 7 Philip Withnall 2012-06-25 23:05:01 UTC
(In reply to comment #6)
> How exactly do you test this?  Are contacts from eds shown in empathy somehow?
> Only if they are linked to an im contact?  Or are you just testing in
> folks-inspect?

With the patch from bug #676383, this should be testable in gnome-contacts itself — if it’s working, only the contacts from the “My Contacts” group should be listed. I just tested in folks-inspect, though.
Comment 8 Alexander Larsson 2012-06-29 12:04:12 UTC
I'm actually also interested in whether a contact is a google plus person from his circles. Is that possible to detect reliably?
Comment 9 Philip Withnall 2012-07-02 20:58:47 UTC
(In reply to comment #8)
> I'm actually also interested in whether a contact is a google plus person from
> his circles. Is that possible to detect reliably?

I’ve just checked the XML we get from Google’s API again, and there’s still absolutely nothing to differentiate Google+ contacts from contacts in your address book other than the presence of a link to their Google+ profile.

I think it would make sense to move the hack for this into folks, though. Do you think it should be exposed as another boolean, or should I rework the patch to expose a set of well-known identifiers for things like “My Contacts” and Google+ profiles?
Comment 10 Alexander Larsson 2012-07-11 18:57:22 UTC
Thats kinda weird. Maybe you could file a bug against google for that?
Comment 11 Philip Withnall 2012-07-11 20:56:11 UTC
(In reply to comment #10)
> Thats kinda weird. Maybe you could file a bug against google for that?

Filed:
http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3154

I do not have high hopes for anyone from Google responding to this, let alone it being fixed.

(In reply to comment #9)
> I think it would make sense to move the hack for this into folks, though. Do
> you think it should be exposed as another boolean, or should I rework the patch
> to expose a set of well-known identifiers for things like “My Contacts” and
> Google+ profiles?

Thoughts about this?
Comment 12 Jeremy Whiting 2012-07-13 17:09:02 UTC
I think this patch is ready to be merged.  Then later on if google adds a way to differentiate the different contact types, we can add support for that later on.
Comment 13 Jeremy Whiting 2012-07-13 17:10:42 UTC
Review of attachment 217107 [details] [review]:

I think this patch is good for now, we can add support for google+ contacts after google adds a way to differentiate them (if they ever do).
Comment 14 Alexander Larsson 2012-07-13 19:47:23 UTC
Moving the hack to folks sounds good to me.
Comment 15 Philip Withnall 2012-07-13 22:13:41 UTC
Review of attachment 217107 [details] [review]:

commit 85e8d88f2dae0480d9804f6e60f9e6575cb9488a
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jun 24 11:50:06 2012 +0100

    eds: Add an Edsf.Persona.in_google_personal_group property
    
    This is set whenever the persona is in the “My Contacts” group in Google
    Contacts, which is normally exposed by EDS as being in the “Personal”
    category. This system group can’t be reliably detected normally as “Personal”
    is translated by EDS. This caused problems for gnome-contacts, hence the
    new API.
    
    The new API requires EDS 3.5.3 at runtime, and will always be false
    otherwise.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=676383

 NEWS                               |    3 +-
 backends/eds/lib/edsf-persona.vala |   47 +++++++++++++++++++++++++++++++++++-
 2 files changed, 48 insertions(+), 2 deletions(-)
Comment 16 Alexander Larsson 2012-07-16 17:55:06 UTC
Any chance you could update the patch in bug 676383? I'm on vacation and won't have time to do this myself.