[Telepathy-commits] [telepathy-gabble/master] conn-olpc: assume that conn->muc_factory is a GabbleChannelManager, not a TpChannelFactoryIface

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Aug 21 06:31:59 PDT 2008


20080805155130-53eee-e84527e4a3b4f917722f9f10cd6064d1fd1057e2.gz
---
 src/conn-olpc.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 52508da..6f1f6d8 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -22,12 +22,12 @@
 
 #include <string.h>
 
-#include <telepathy-glib/channel-iface.h>
 #include <telepathy-glib/util.h>
 
 #define DEBUG_FLAG GABBLE_DEBUG_OLPC
 
 #include "debug.h"
+#include "channel-manager.h"
 #include "connection.h"
 #include "muc-channel.h"
 #include "presence-cache.h"
@@ -2496,11 +2496,12 @@ muc_channel_contact_join_cb (GabbleMucChannel *chan,
 }
 
 static void
-muc_factory_new_channel_cb (GabbleMucFactory *fac,
-                            TpChannelIface *chan,
-                            gpointer opaque_request,
-                            GabbleConnection *conn)
+muc_factory_new_channel_cb (gpointer key,
+                            gpointer value,
+                            gpointer data)
 {
+  GabbleConnection *conn = GABBLE_CONNECTION (data);
+  GabbleExportableChannel *chan = GABBLE_EXPORTABLE_CHANNEL (key);
   ActivityInfo *info;
   TpHandle room_handle;
 
@@ -2515,6 +2516,7 @@ muc_factory_new_channel_cb (GabbleMucFactory *fac,
 
   info = g_hash_table_lookup (conn->olpc_activities_info,
       GUINT_TO_POINTER (room_handle));
+
   if (info == NULL)
     {
       info = add_activity_info (conn, room_handle);
@@ -2533,6 +2535,14 @@ muc_factory_new_channel_cb (GabbleMucFactory *fac,
 }
 
 static void
+muc_factory_new_channels_cb (GabbleMucFactory *fac,
+                             GHashTable *channels,
+                             GabbleConnection *conn)
+{
+  g_hash_table_foreach (channels, muc_factory_new_channel_cb, conn);
+}
+
+static void
 connection_presence_do_update (GabblePresenceCache *cache,
                                TpHandle handle,
                                GabbleConnection *conn)
@@ -2622,8 +2632,8 @@ conn_olpc_activity_properties_init (GabbleConnection *conn)
   g_signal_connect (conn, "status-changed",
       G_CALLBACK (connection_status_changed_cb), NULL);
 
-  g_signal_connect (conn->muc_factory, "new-channel",
-      G_CALLBACK (muc_factory_new_channel_cb), conn);
+  g_signal_connect (GABBLE_CHANNEL_MANAGER (conn->muc_factory), "new-channels",
+      G_CALLBACK (muc_factory_new_channels_cb), conn);
 
   g_signal_connect (conn->presence_cache, "presences-updated",
       G_CALLBACK (connection_presences_updated_cb), conn);
-- 
1.5.6.3




More information about the Telepathy-commits mailing list