telepathy-gabble: connection: Don' t reset the capabilities in UpdateCapabilities

Will Thompson wjt at kemper.freedesktop.org
Fri Nov 9 09:18:25 PST 2012


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

Author: Debarshi Ray <rishi at gnu.org>
Date:   Fri Oct 19 16:17:35 2012 +0200

connection: Don't reset the capabilities in UpdateCapabilities

This ensures that a running Gabble process will always create Call1
channels once it has seen such a client in its lifetime.

Remove gabble_caps_channel_manager_reset_capabilities and its
implementation in GabbleMediaFactory, since it is not used anymore.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56181
Reviewed-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>

---

 gabble/caps-channel-manager.h |    3 ---
 src/caps-channel-manager.c    |   15 ---------------
 src/connection.c              |   15 ++-------------
 src/media-factory.c           |    9 ---------
 4 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/gabble/caps-channel-manager.h b/gabble/caps-channel-manager.h
index 9442476..a41bd20 100644
--- a/gabble/caps-channel-manager.h
+++ b/gabble/caps-channel-manager.h
@@ -73,9 +73,6 @@ typedef void (*GabbleCapsChannelManagerRepresentClientFunc) (
     GabbleCapabilitySet *cap_set,
     GPtrArray *data_forms);
 
-void gabble_caps_channel_manager_reset_capabilities (
-    GabbleCapsChannelManager *caps_manager);
-
 void gabble_caps_channel_manager_get_contact_capabilities (
     GabbleCapsChannelManager *caps_manager,
     TpHandle handle,
diff --git a/src/caps-channel-manager.c b/src/caps-channel-manager.c
index dea13a6..135427a 100644
--- a/src/caps-channel-manager.c
+++ b/src/caps-channel-manager.c
@@ -42,21 +42,6 @@ gabble_caps_channel_manager_default_init (
 
 /* Virtual-method wrappers */
 void
-gabble_caps_channel_manager_reset_capabilities (
-    GabbleCapsChannelManager *caps_manager)
-{
-  GabbleCapsChannelManagerInterface *iface =
-    GABBLE_CAPS_CHANNEL_MANAGER_GET_INTERFACE (caps_manager);
-  GabbleCapsChannelManagerResetCapsFunc method = iface->reset_caps;
-
-  if (method != NULL)
-    {
-      method (caps_manager);
-    }
-  /* ... else assume there is no need to reset the caps */
-}
-
-void
 gabble_caps_channel_manager_get_contact_capabilities (
     GabbleCapsChannelManager *caps_manager,
     TpHandle handle,
diff --git a/src/connection.c b/src/connection.c
index 5ea0d1a..e53b3de 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -3368,25 +3368,12 @@ gabble_connection_update_capabilities (
   GabbleConnection *self = GABBLE_CONNECTION (iface);
   TpBaseConnection *base = (TpBaseConnection *) self;
   GabbleCapabilitySet *old_caps = NULL;
-  TpChannelManagerIter iter;
-  TpChannelManager *manager;
   guint i;
 
   /* Now that someone has told us our *actual* capabilities, we can stop
    * advertising spurious caps in initial presence */
   gabble_capability_set_clear (self->priv->bonus_caps);
 
-  tp_base_connection_channel_manager_iter_init (&iter, base);
-
-  while (tp_base_connection_channel_manager_iter_next (&iter, &manager))
-    {
-      if (GABBLE_IS_CAPS_CHANNEL_MANAGER (manager))
-        {
-          gabble_caps_channel_manager_reset_capabilities (
-              GABBLE_CAPS_CHANNEL_MANAGER (manager));
-        }
-    }
-
   DEBUG ("enter");
 
   for (i = 0; i < clients->len; i++)
@@ -3397,6 +3384,8 @@ gabble_connection_update_capabilities (
       const gchar * const * cap_tokens = g_value_get_boxed (va->values + 2);
       GabbleCapabilitySet *cap_set;
       GPtrArray *data_forms;
+      TpChannelManagerIter iter;
+      TpChannelManager *manager;
 
       g_hash_table_remove (self->priv->client_caps, client_name);
       g_hash_table_remove (self->priv->client_data_forms, client_name);
diff --git a/src/media-factory.c b/src/media-factory.c
index 493a817..8f3e397 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -1124,14 +1124,6 @@ _gabble_media_factory_typeflags_to_caps (TpChannelMediaCapabilities flags,
 }
 
 static void
-gabble_media_factory_reset_caps (GabbleCapsChannelManager *manager)
-{
-  GabbleMediaFactory *self = GABBLE_MEDIA_FACTORY (manager);
-
-  self->priv->use_call_channels = FALSE;
-}
-
-static void
 gabble_media_factory_get_contact_caps (GabbleCapsChannelManager *manager,
     TpHandle handle,
     const GabbleCapabilitySet *caps,
@@ -1342,7 +1334,6 @@ caps_channel_manager_iface_init (gpointer g_iface,
 {
   GabbleCapsChannelManagerInterface *iface = g_iface;
 
-  iface->reset_caps = gabble_media_factory_reset_caps;
   iface->get_contact_caps = gabble_media_factory_get_contact_caps;
   iface->represent_client = gabble_media_factory_represent_client;
 }



More information about the telepathy-commits mailing list