[Telepathy-commits] [telepathy-salut/master] SalutContactChannel: Add TargetID property

Sjoerd Simons sjoerd.simons at collabora.co.uk
Tue Aug 19 10:55:58 PDT 2008


---
 src/salut-contact-channel.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/salut-contact-channel.c b/src/salut-contact-channel.c
index 81d71c3..242a0fc 100644
--- a/src/salut-contact-channel.c
+++ b/src/salut-contact-channel.c
@@ -60,6 +60,7 @@ enum
   PROP_HANDLE,
   PROP_CONNECTION,
   PROP_INTERFACES,
+  PROP_TARGET_ID,
   LAST_PROPERTY
 };
 
@@ -156,6 +157,14 @@ salut_contact_channel_get_property (GObject    *object,
       case PROP_INTERFACES:
         g_value_set_static_boxed (value, salut_contact_channel_interfaces);
         break;
+    case PROP_TARGET_ID:
+      {
+         TpHandleRepoIface *repo = tp_base_connection_get_handles (
+           (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_LIST);
+
+         g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+      }
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -206,6 +215,7 @@ salut_contact_channel_class_init (SalutContactChannelClass *salut_contact_channe
   static TpDBusPropertiesMixinPropImpl channel_props[] = {
       { "TargetHandleType", "handle-type", NULL },
       { "TargetHandle", "handle", NULL },
+      { "TargetID", "target-id", NULL },
       { "ChannelType", "channel-type", NULL },
       { "Interfaces", "interfaces", NULL },
       { NULL }
@@ -257,6 +267,13 @@ salut_contact_channel_class_init (SalutContactChannelClass *salut_contact_channe
       "handle-type");
   g_object_class_override_property (object_class, PROP_HANDLE, "handle");
 
+  param_spec = g_param_spec_string ("target-id", "Target JID",
+      "The string obtained by inspecting this channel's handle",
+      NULL,
+      G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+      G_PARAM_STATIC_BLURB);
+  g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
   salut_contact_channel_class->dbus_props_class.interfaces = prop_interfaces;
   tp_dbus_properties_mixin_class_init (object_class,
       G_STRUCT_OFFSET (SalutContactChannelClass, dbus_props_class));
-- 
1.5.6.3




More information about the Telepathy-commits mailing list