[Telepathy-commits] [telepathy-gabble/master] Every Channel Managers must now implement the GABBLE_CAPS_CHANNEL_MANAGER interface.

Alban Crequy alban.crequy at collabora.co.uk
Fri Dec 5 09:42:38 PST 2008


---
 src/connection.c       |   16 ++++++----------
 src/im-factory.c       |    1 -
 src/media-factory.c    |    4 +++-
 src/muc-factory.c      |    4 +++-
 src/presence-cache.c   |    5 ++---
 src/roomlist-manager.c |    4 +++-
 src/roster.c           |    4 +++-
 7 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 11f2745..ca56823 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2165,9 +2165,8 @@ gabble_connection_get_handle_contact_capabilities (GabbleConnection *self,
   tp_base_connection_channel_manager_iter_init (&iter, base_conn);
   while (tp_base_connection_channel_manager_iter_next (&iter, &manager))
     {
-      /* some channel managers does not implement the capability interface */
-      if (!GABBLE_IS_CAPS_CHANNEL_MANAGER (manager))
-        continue;
+      /* all channel managers must implement the capability interface */
+      g_assert (GABBLE_IS_CAPS_CHANNEL_MANAGER (manager));
 
       gabble_caps_channel_manager_get_contact_capabilities (
           GABBLE_CAPS_CHANNEL_MANAGER (manager), self, handle, arr);
@@ -2194,9 +2193,8 @@ _emit_contact_capabilities_changed (GabbleConnection *conn,
       gpointer per_channel_factory_caps_old = NULL;
       gpointer per_channel_factory_caps_new = NULL;
 
-      /* some channel managers does not implement the capability interface */
-      if (!GABBLE_IS_CAPS_CHANNEL_MANAGER (manager))
-        continue;
+      /* all channel managers must implement the capability interface */
+      g_assert (GABBLE_IS_CAPS_CHANNEL_MANAGER (manager));
 
       if (old_caps != NULL)
         per_channel_factory_caps_old = g_hash_table_lookup (old_caps, manager);
@@ -2411,10 +2409,8 @@ gabble_connection_set_self_capabilities (
       tp_base_connection_channel_manager_iter_init (&iter, base);
       while (tp_base_connection_channel_manager_iter_next (&iter, &manager))
         {
-          /* some channel managers does not implement the capability interface
-           */
-          if (!GABBLE_IS_CAPS_CHANNEL_MANAGER (manager))
-            continue;
+          /* all channel managers must implement the capability interface */
+          g_assert (GABBLE_IS_CAPS_CHANNEL_MANAGER (manager));
 
           gabble_caps_channel_manager_add_capability (
               GABBLE_CAPS_CHANNEL_MANAGER (manager), self,
diff --git a/src/im-factory.c b/src/im-factory.c
index f48968f..d94aa37 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -36,7 +36,6 @@
 #include "extensions/extensions.h"
 
 #include "caps-channel-manager.h"
-
 #include "connection.h"
 #include "debug.h"
 #include "disco.h"
diff --git a/src/media-factory.c b/src/media-factory.c
index e167f4f..c7375a7 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -34,6 +34,7 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
+#include "caps-channel-manager.h"
 #include "connection.h"
 #include "debug.h"
 #include "media-channel.h"
@@ -48,7 +49,8 @@ static LmHandlerResult media_factory_jingle_cb (LmMessageHandler *,
 G_DEFINE_TYPE_WITH_CODE (GabbleMediaFactory, gabble_media_factory,
     G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
-      channel_manager_iface_init));
+      channel_manager_iface_init);
+    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL));
 
 /* properties */
 enum
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 38133eb..b45ce63 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -34,6 +34,7 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MUC
 
+#include "caps-channel-manager.h"
 #include "connection.h"
 #include "conn-olpc.h"
 #include "debug.h"
@@ -49,7 +50,8 @@ static void channel_manager_iface_init (gpointer, gpointer);
 
 G_DEFINE_TYPE_WITH_CODE (GabbleMucFactory, gabble_muc_factory, G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
-      channel_manager_iface_init));
+      channel_manager_iface_init);
+    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL));
 
 /* properties */
 enum
diff --git a/src/presence-cache.c b/src/presence-cache.c
index 0a1279f..24061f1 100644
--- a/src/presence-cache.c
+++ b/src/presence-cache.c
@@ -879,9 +879,8 @@ _caps_disco_cb (GabbleDisco *disco,
     {
       gpointer *factory_caps;
 
-      /* some channel managers does not implement the capability interface */
-      if (!GABBLE_IS_CAPS_CHANNEL_MANAGER (manager))
-        continue;
+      /* all channel managers must implement the capability interface */
+      g_assert (GABBLE_IS_CAPS_CHANNEL_MANAGER (manager));
 
       factory_caps = gabble_caps_channel_manager_parse_capabilities
           (GABBLE_CAPS_CHANNEL_MANAGER (manager), query_result->children);
diff --git a/src/roomlist-manager.c b/src/roomlist-manager.c
index e16627a..8452c33 100644
--- a/src/roomlist-manager.c
+++ b/src/roomlist-manager.c
@@ -33,6 +33,7 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MUC
 
+#include "caps-channel-manager.h"
 #include "connection.h"
 #include "debug.h"
 #include "namespaces.h"
@@ -46,7 +47,8 @@ static void channel_manager_iface_init (gpointer, gpointer);
 G_DEFINE_TYPE_WITH_CODE (GabbleRoomlistManager, gabble_roomlist_manager,
     G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
-      channel_manager_iface_init));
+      channel_manager_iface_init);
+    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL));
 
 
 /* properties */
diff --git a/src/roster.c b/src/roster.c
index 09cc3f6..bc8ec00 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -33,6 +33,7 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_ROSTER
 
+#include "caps-channel-manager.h"
 #include "conn-aliasing.h"
 #include "connection.h"
 #include "debug.h"
@@ -133,7 +134,8 @@ static void gabble_roster_close_all (GabbleRoster *roster);
 
 G_DEFINE_TYPE_WITH_CODE (GabbleRoster, gabble_roster, G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
-      channel_manager_iface_init));
+      channel_manager_iface_init);
+    G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL));
 
 #define GABBLE_ROSTER_GET_PRIVATE(o) ((o)->priv)
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list