[folks] Add the display-id property to Persona.
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Add the display-id property to Persona.
- Date: Tue, 3 Aug 2010 21:22:33 +0000 (UTC)
commit 5d37ec9e7b313d66fee2a7c79ee964af3c799813
Author: Travis Reitter <travis reitter collabora co uk>
Date: Tue Aug 3 15:43:39 2010 -0400
Add the display-id property to Persona.
This is meant to be a human-readable, familiar identifier for presenting to the
user (when absolutely necessary).
backends/key-file/kf-persona.vala | 5 ++++-
backends/telepathy/tpf-persona.vala | 4 +++-
folks/persona.vala | 16 ++++++++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/backends/key-file/kf-persona.vala b/backends/key-file/kf-persona.vala
index 8f755f1..df5b935 100644
--- a/backends/key-file/kf-persona.vala
+++ b/backends/key-file/kf-persona.vala
@@ -84,11 +84,14 @@ public class Folks.Backends.Kf.Persona : Folks.Persona,
{
string[] linkable_properties = { "im-addresses" };
- Object (iid: id,
+ Object (display_id: id,
+ iid: id,
uid: this.build_uid ("key-file", store.id, id),
store: store,
linkable_properties: linkable_properties);
+ debug ("Adding key-file Persona '%s'", id);
+
this.key_file = key_file;
this._im_addresses = new HashTable<string, GenericArray<string>> (
str_hash, str_equal);
diff --git a/backends/telepathy/tpf-persona.vala b/backends/telepathy/tpf-persona.vala
index f6fdf79..5acb443 100644
--- a/backends/telepathy/tpf-persona.vala
+++ b/backends/telepathy/tpf-persona.vala
@@ -187,6 +187,7 @@ public class Tpf.Persona : Folks.Persona,
Object (alias: alias,
contact: contact,
+ display_id: id,
/* FIXME: This IID format should be moved out to the IMable
* interface along with the code in
* Kf.Persona.linkable_property_to_links(), but that depends on
@@ -195,7 +196,8 @@ public class Tpf.Persona : Folks.Persona,
uid: uid,
store: store);
- debug ("Creating new Tpf.Persona '%s': %p", uid, this);
+ debug ("Creating new Tpf.Persona '%s' for service-specific UID '%s': %p",
+ uid, id, this);
this.is_constructed = true;
this._groups = new HashTable<string, bool> (str_hash, str_equal);
diff --git a/folks/persona.vala b/folks/persona.vala
index 4f43e70..e3bdfba 100644
--- a/folks/persona.vala
+++ b/folks/persona.vala
@@ -66,6 +66,22 @@ public abstract class Folks.Persona : Object
public string uid { get; construct; }
/**
+ * The human-readable, service-specific universal ID used to represent the
+ * Persona.
+ *
+ * For example: `foo@@xmpp.example.org`.
+ *
+ * This should be used whenever the user needs to be presented with a
+ * familiar, service-specific ID. For instance, in a prompt for the user to
+ * select a specific IM contact within an { link Individual} to begin a chat
+ * with.
+ *
+ * This is not guaranteed to be unique outside of the Persona's
+ * { link PersonaStore}.
+ */
+ public string display_id { get; construct; }
+
+ /**
* The { link PersonaStore} which contains this Persona.
*/
public weak PersonaStore store { get; construct; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]