[empathy] stop handling internally FT channels



commit b5b068d39f35ace8b1328c27a0b3d7e9de735dea
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Jun 29 16:39:06 2010 +0200

    stop handling internally FT channels

 libempathy/empathy-dispatch-operation.c |   13 +-----
 src/empathy.c                           |   65 +-----------------------------
 2 files changed, 5 insertions(+), 73 deletions(-)
---
diff --git a/libempathy/empathy-dispatch-operation.c b/libempathy/empathy-dispatch-operation.c
index fa71f01..adb76c7 100644
--- a/libempathy/empathy-dispatch-operation.c
+++ b/libempathy/empathy-dispatch-operation.c
@@ -27,8 +27,6 @@
 #include "empathy-dispatch-operation.h"
 #include <libempathy/empathy-enum-types.h>
 #include <libempathy/empathy-tp-contact-factory.h>
-#include <libempathy/empathy-tp-call.h>
-#include <libempathy/empathy-tp-file.h>
 
 #include "empathy-marshal.h"
 
@@ -424,7 +422,8 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
 {
   EmpathyDispatchOperation *self = EMPATHY_DISPATCH_OPERATION (user_data);
   EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
-  GQuark channel_type;
+
+  /* FIXME: remove */
 
   /* The error will be handled in empathy_dispatch_operation_invalidated */
   if (error != NULL)
@@ -440,14 +439,6 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
   if (priv->channel_wrapper != NULL)
     goto ready;
 
-  channel_type = tp_channel_get_channel_type_id (channel);
-
-  if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
-    {
-       EmpathyTpFile *file = empathy_tp_file_new (channel, priv->incoming);
-       priv->channel_wrapper = G_OBJECT (file);
-    }
-
 ready:
   empathy_dispatch_operation_set_status (self,
     EMPATHY_DISPATCHER_OPERATION_STATE_PENDING);
diff --git a/src/empathy.c b/src/empathy.c
index 82be5ce..bb39263 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -82,30 +82,6 @@ static void account_manager_ready_cb (GObject *source_object,
     gpointer user_data);
 
 static void
-dispatch_cb (EmpathyDispatcher *dispatcher,
-    EmpathyDispatchOperation *operation,
-    gpointer user_data)
-{
-  GQuark channel_type;
-
-  channel_type = empathy_dispatch_operation_get_channel_type_id (operation);
-
-  if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
-    {
-      EmpathyFTFactory *factory;
-
-      factory = empathy_ft_factory_dup_singleton ();
-
-      /* if the operation is not incoming, don't claim it,
-       * as it might have been triggered by another client, and
-       * we are observing it.
-       */
-      if (empathy_dispatch_operation_is_incoming (operation))
-        empathy_ft_factory_claim_channel (factory, operation);
-    }
-}
-
-static void
 use_conn_notify_cb (GSettings *gsettings,
     const gchar *key,
     gpointer     user_data)
@@ -313,41 +289,6 @@ account_manager_ready_cb (GObject *source_object,
   g_object_unref (gsettings);
 }
 
-static EmpathyDispatcher *
-setup_dispatcher (void)
-{
-  EmpathyDispatcher *d;
-  GPtrArray *filters;
-  struct {
-    const gchar *channeltype;
-    TpHandleType handletype;
-  } types[] = {
-    /* file transfer to contacts */
-    { TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_HANDLE_TYPE_CONTACT  },
-  };
-  GHashTable *asv;
-  guint i;
-
-  /* Setup the an extended Client.Handler that matches everything we can do */
-  filters = g_ptr_array_new ();
-  for (i = 0 ; i < G_N_ELEMENTS (types); i++)
-    {
-      asv = tp_asv_new (
-        TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING, types[i].channeltype,
-        TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_INT, types[i].handletype,
-        NULL);
-
-      g_ptr_array_add (filters, asv);
-    }
-
-  d = empathy_dispatcher_new (PACKAGE_NAME"MoreThanMeetsTheEye", filters, NULL);
-
-  g_ptr_array_foreach (filters, (GFunc) g_hash_table_destroy, NULL);
-  g_ptr_array_free (filters, TRUE);
-
-  return d;
-}
-
 static void
 account_status_changed_cb (TpAccount *account,
     guint old_status,
@@ -557,9 +498,9 @@ main (int argc, char *argv[])
   tp_account_manager_prepare_async (account_manager, NULL,
       account_manager_ready_cb, NULL);
 
-  /* Handle channels */
-  dispatcher = setup_dispatcher ();
-  g_signal_connect (dispatcher, "dispatch", G_CALLBACK (dispatch_cb), NULL);
+  /* The EmpathyDispatcher doesn't dispatch anything any more but we have to
+   * keep it around as we still use it to request channels */
+  dispatcher = empathy_dispatcher_dup_singleton ();
 
   migrate_config_to_xdg_dir ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]