telepathy-mission-control: McdChannel: use tp_channel_get_requested instead of reinventing it

Simon McVittie smcv at kemper.freedesktop.org
Mon Oct 8 07:27:45 PDT 2012


Module: telepathy-mission-control
Branch: master
Commit: e913203ccfe06fbf3435be69b0e6b07d1828ce73
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=e913203ccfe06fbf3435be69b0e6b07d1828ce73

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Sep 14 14:42:29 2012 +0100

McdChannel: use tp_channel_get_requested instead of reinventing it

MC's reinvention was potentially better if the channel might lack the
Requested property... but that property has been mandatory for years,
so CMs that haven't caught up can just deal with it.

Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391
Reviewed-by: Xavier Claessens <xavier.claessens at collabora.co.uk>

---

 src/mcd-channel.c |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index 4f0a893..4310ba0 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -120,8 +120,6 @@ on_channel_ready (GObject *source_object, GAsyncResult *result, gpointer user_da
 {
     TpChannel *tp_chan = TP_CHANNEL (source_object);
     McdChannel *channel, **channel_ptr = user_data;
-    McdChannelPrivate *priv;
-    gboolean requested, valid;
     GError *error = NULL;
 
     if (!tp_proxy_prepare_finish (tp_chan, result, &error))
@@ -145,12 +143,7 @@ on_channel_ready (GObject *source_object, GAsyncResult *result, gpointer user_da
     if (!channel) return;
 
     DEBUG ("channel %p is ready", channel);
-    priv = channel->priv;
-    requested = tp_asv_get_boolean
-        (tp_channel_borrow_immutable_properties (tp_chan),
-         TP_IFACE_CHANNEL ".Requested", &valid);
-    if (valid)
-        priv->outgoing = requested;
+    channel->priv->outgoing = tp_channel_get_requested (tp_chan);
 }
 
 void
@@ -217,7 +210,6 @@ static void
 _mcd_channel_setup (McdChannel *channel, McdChannelPrivate *priv)
 {
     McdChannel **channel_ptr;
-    GHashTable *properties;
 
     channel_ptr = g_slice_alloc (sizeof (McdChannel *));
     *channel_ptr = channel;
@@ -227,15 +219,7 @@ _mcd_channel_setup (McdChannel *channel, McdChannelPrivate *priv)
     g_signal_connect (priv->tp_chan, "invalidated",
 		      G_CALLBACK (proxy_destroyed), channel);
 
-    properties = tp_channel_borrow_immutable_properties (priv->tp_chan);
-    if (properties)
-    {
-        gboolean requested, valid = FALSE;
-        requested = tp_asv_get_boolean
-            (properties, TP_IFACE_CHANNEL ".Requested", &valid);
-        if (valid)
-            priv->outgoing = requested;
-    }
+    priv->outgoing = tp_channel_get_requested (priv->tp_chan);
 }
 
 static void



More information about the telepathy-commits mailing list