telepathy-gabble: muc-factory: simplify code to get IM channel from InitialChannels

Jonny Lamb jonny at kemper.freedesktop.org
Tue Aug 28 06:19:32 PDT 2012


Module: telepathy-gabble
Branch: master
Commit: 1b08b38de7166ae229555ff9aecf49278d67a97c
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=1b08b38de7166ae229555ff9aecf49278d67a97c

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Mon Mar 26 17:53:31 2012 -0400

muc-factory: simplify code to get IM channel from InitialChannels

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 src/muc-factory.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/muc-factory.c b/src/muc-factory.c
index 6e8e13a..6fa29a1 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -1194,7 +1194,7 @@ handle_text_channel_request (GabbleMucFactory *self,
           const char *object_path = g_ptr_array_index (initial_channels, i);
           GObject *object;
           TpHandle handle;
-          GabbleConnection *connection;
+          TpBaseConnection *connection;
 
           object = dbus_g_connection_lookup_g_object (bus, object_path);
 
@@ -1205,19 +1205,19 @@ handle_text_channel_request (GabbleMucFactory *self,
               continue;
             }
 
-          g_object_get (object,
-              "connection", &connection,
-              "handle", &handle,
-              NULL);
-          g_object_unref (connection); /* drop the ref immediately */
+          connection = tp_base_channel_get_connection (
+              TP_BASE_CHANNEL (object));
 
-          if (connection != priv->conn)
+          if ((GabbleConnection *) connection != priv->conn)
             {
               DEBUG ("Channel %s is from a different Connection, ignoring",
                   object_path);
               continue;
             }
 
+          handle = tp_base_channel_get_target_handle (
+              TP_BASE_CHANNEL (object));
+
           tp_handle_set_add (handles, handle);
           tp_intset_add (continue_handles, handle);
           g_hash_table_insert (final_channels, (char *) object_path, NULL);



More information about the telepathy-commits mailing list