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 723187 - there is no way to detect automatic created im fields
there is no way to detect automatic created im fields
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: e-d-s backend
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-28 20:14 UTC by Renato Araujo Oliveira Filho
Modified: 2014-01-31 15:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch to add a extra attribute in the im field (1.62 KB, patch)
2014-01-28 20:30 UTC, Renato Araujo Oliveira Filho
needs-work Details | Review
A patch to add a extra attribute in the im field (1.94 KB, patch)
2014-01-31 14:30 UTC, Renato Araujo Oliveira Filho
needs-work Details | Review
eds: Add a extra parameter on IM fields created based on e-mail address (2.65 KB, patch)
2014-01-31 15:40 UTC, Philip Withnall
committed Details | Review

Description Renato Araujo Oliveira Filho 2014-01-28 20:14:46 UTC
EDS backend creates automatic Im fields based on contact e-mail address to make it possible to link with telepathy contacts.

But there is no way to detect if the field is a real data or just a virtual field.
Comment 1 Renato Araujo Oliveira Filho 2014-01-28 20:30:40 UTC
Created attachment 267439 [details] [review]
A patch to add a extra attribute in the im field
Comment 2 Philip Withnall 2014-01-30 09:57:03 UTC
Review of attachment 267439 [details] [review]:

Looks good to me. A few cosmetic changes are necessary though. :-)

::: backends/eds/lib/edsf-persona.vala
@@ +121,3 @@
+   * on the field.
+   *
+   */

I think the comment can be simplified a bit to:

/**
 * Name of folks’ custom parameter indicating automatic fields
 *
 * Folks can create extra fields to improve linking between personas.
 * These fields have a boolean-typed parameter added with this name,
 * and the value ‘TRUE’. This allows clients to detect such fields
 * and (for example) ignore them in the UI.
 *
 * Since: UNRELEASED
 */

@@ +1736,3 @@
                   var im_fd = new ImFieldDetails (normalised_addr);
+                  im_fd.add_parameter (
+                      Edsf.Persona.folks_field_attribute_name, "TRUE");

You might want to amend the big comment (which mentions bug #657142) just above this section to say that clients can use the X-FOLKS-FIELD property to detect IM addresses which may not be used.
Comment 3 Renato Araujo Oliveira Filho 2014-01-31 14:30:20 UTC
Created attachment 267732 [details] [review]
A patch to add a extra attribute in the im field
Comment 4 Philip Withnall 2014-01-31 15:37:21 UTC
Review of attachment 267732 [details] [review]:

::: backends/eds/lib/edsf-persona.vala
@@ +1739,3 @@
+                     to flag it adding a new parameter X-FOLKS-FIELD, this will
+                     allow the top-level API to detect it and choose if use it
+                     or not. See bug #657142 */

No, I meant you should *amend* the big comment here:
https://git.gnome.org/browse/folks/tree/backends/eds/lib/edsf-persona.vala#n1685
not add a new one! :-)
Comment 5 Philip Withnall 2014-01-31 15:40:27 UTC
Created attachment 267738 [details] [review]
eds: Add a extra parameter on IM fields created based on e-mail address
Comment 6 Philip Withnall 2014-01-31 15:42:57 UTC
I pushed the patch with the above issue fixed. Thanks!

Attachment 267738 [details] pushed as 8d17efe - eds: Add a extra parameter on IM fields created based on e-mail address