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

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


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

diff --git a/src/salut-muc-channel.c b/src/salut-muc-channel.c
index cbf8493..c5380ca 100644
--- a/src/salut-muc-channel.c
+++ b/src/salut-muc-channel.c
@@ -92,6 +92,7 @@ enum
   PROP_CREATOR,
   PROP_XMPP_CONNECTION_MANAGER,
   PROP_INTERFACES,
+  PROP_TARGET_ID,
   LAST_PROPERTY
 };
 
@@ -173,6 +174,14 @@ salut_muc_channel_get_property (GObject    *object,
     case PROP_INTERFACES:
       g_value_set_static_boxed (value, salut_muc_channel_interfaces);
       break;
+    case PROP_TARGET_ID:
+      {
+         TpHandleRepoIface *repo = tp_base_connection_get_handles (
+           (TpBaseConnection *) chan->connection, TP_HANDLE_TYPE_ROOM);
+
+         g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+      }
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -678,6 +687,7 @@ salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
   static TpDBusPropertiesMixinPropImpl channel_props[] = {
       { "TargetHandleType", "handle-type", NULL },
       { "TargetHandle", "handle", NULL },
+      { "TargetID", "target-id", NULL },
       { "ChannelType", "channel-type", NULL },
       { "Interfaces", "interfaces", NULL },
       { NULL }
@@ -709,6 +719,13 @@ salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
                                     "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);
+
   param_spec = g_param_spec_string ("name",
                                     "Name of the muc group",
                                     "The name of the muc group",
-- 
1.5.6.3




More information about the Telepathy-commits mailing list