summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2014-01-28 17:23:53 -0300
committerPhilip Withnall <philip@tecnocode.co.uk>2014-01-31 15:40:02 +0000
commit8d17efeb1f750dc9e6ae21993c50ed254c8972b5 (patch)
tree90b237d8b50a3d5c5cafcc66d3d38144d88314b8 /backends
parenteac52ef741bade059d077bd149889accb40ab2af (diff)
eds: Add a extra parameter on IM fields created based on e-mail address
https://bugzilla.gnome.org/show_bug.cgi?id=723187
Diffstat (limited to 'backends')
-rw-r--r--backends/eds/lib/edsf-persona.vala24
1 files changed, 21 insertions, 3 deletions
diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala
index 26cd2e03..7a076f18 100644
--- a/backends/eds/lib/edsf-persona.vala
+++ b/backends/eds/lib/edsf-persona.vala
@@ -112,6 +112,18 @@ public class Edsf.Persona : Folks.Persona,
};
/**
+ * 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
+ */
+ public static const string folks_field_attribute_name = "X-FOLKS-FIELD";
+
+ /**
* The vCard attribute used to specify a Contact's gender
*
* Based on:
@@ -1683,13 +1695,16 @@ public class Edsf.Persona : Folks.Persona,
}
/* We consider some e-mail addresses to be IM IDs too. This
- * is pretty much a hack to make sure e-d-s contacts are
+ * is pretty much a hack to make sure EDS contacts are
* automatically linked with their corresponding Telepathy
* Persona. As an undesired side effect we might end up having
* IM addresses that aren't actually used as such (i.e.: people
- * who don't actually use GMail or MSN addresses for IM).
+ * who don't actually use GMail or MSN addresses for IM): this can be
+ * detected by clients by looking for the
+ * {@link Edsf.Persona.folks_field_attribute_name} parameter existing and
+ * being set to `TRUE` on the {@link ImFieldDetails}.
*
- * See bgo#657142
+ * See: bgo#657142, bgo#723187
*/
foreach (var email in this._email_addresses)
{
@@ -1722,6 +1737,9 @@ public class Edsf.Persona : Folks.Persona,
string normalised_addr =
ImDetails.normalise_im_address (email.value, proto);
var im_fd = new ImFieldDetails (normalised_addr);
+
+ im_fd.add_parameter (
+ Edsf.Persona.folks_field_attribute_name, "TRUE");
new_im_addresses.set (proto, im_fd);
}
catch (Folks.ImDetailsError e)