[Telepathy-commits] [telepathy-gabble/master] MediaChannel: add a peer property for the other person in the call (if known)

Will Thompson will.thompson at collabora.co.uk
Thu Sep 25 07:55:40 PDT 2008


This is distinct from initial-peer in that it can take non-0 values for
anonymous channels once you call RequestStreams
---
 src/media-channel.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index e4fe2e2..c144ce3 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -94,6 +94,7 @@ enum
   PROP_HANDLE,
   PROP_TARGET_ID,
   PROP_INITIAL_PEER,
+  PROP_PEER,
   PROP_REQUESTED,
   PROP_CONNECTION,
   PROP_CREATOR,
@@ -435,6 +436,20 @@ gabble_media_channel_get_property (GObject    *object,
         }
 
       break;
+    case PROP_PEER:
+      {
+        TpHandle peer = 0;
+
+        if (priv->initial_peer != 0)
+          peer = priv->initial_peer;
+        else if (priv->session != NULL)
+          g_object_get (priv->session,
+              "peer", &peer,
+              NULL);
+
+        g_value_set_uint (value, peer);
+        break;
+      }
     case PROP_CONNECTION:
       g_value_set_object (value, priv->conn);
       break;
@@ -626,6 +641,15 @@ gabble_media_channel_class_init (GabbleMediaChannelClass *gabble_media_channel_c
       G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_INITIAL_PEER, param_spec);
 
+  param_spec = g_param_spec_uint ("peer", "Other participant",
+      "The TpHandle representing the other participant in the channel if "
+      "currently known; 0 if this is an anonymous channel on which "
+      "RequestStreams  has not yet been called.",
+      0, G_MAXUINT32, 0,
+      G_PARAM_READABLE |
+      G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
+  g_object_class_install_property (object_class, PROP_PEER, param_spec);
+
   param_spec = g_param_spec_object ("connection", "GabbleConnection object",
       "Gabble connection object that owns this media channel object.",
       GABBLE_TYPE_CONNECTION,
-- 
1.5.6.5




More information about the Telepathy-commits mailing list