]> git.0d.be Git - empathy.git/commitdiff
stop handling text channels using EmpathyDispatcher
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 2 Jul 2010 10:00:46 +0000 (12:00 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 5 Jul 2010 08:13:52 +0000 (10:13 +0200)
libempathy/empathy-dispatch-operation.c
src/empathy.c

index 65fe4b17b88e1ad8ea514ffcc68e07cd7907eef0..e59d69771e28cfec4a872b58c951436f3c4dfc6e 100644 (file)
@@ -27,7 +27,6 @@
 #include "empathy-dispatch-operation.h"
 #include <libempathy/empathy-enum-types.h>
 #include <libempathy/empathy-tp-contact-factory.h>
-#include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-call.h>
 #include <libempathy/empathy-tp-file.h>
 
@@ -416,31 +415,6 @@ empathy_dispatch_operation_set_status (EmpathyDispatchOperation *self,
     }
 }
 
-static void
-channel_wrapper_ready (EmpathyDispatchOperation *self)
-{
-  EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
-
-  g_signal_handler_disconnect (priv->channel_wrapper, priv->ready_handler);
-  priv->ready_handler = 0;
-
-  empathy_dispatch_operation_set_status (self,
-    EMPATHY_DISPATCHER_OPERATION_STATE_PENDING);
-}
-
-static void
-empathy_dispatcher_operation_tp_chat_ready_cb (GObject *object,
-  GParamSpec *spec, gpointer user_data)
-{
-  EmpathyDispatchOperation *self = EMPATHY_DISPATCH_OPERATION (user_data);
-  EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
-
-  if (!empathy_tp_chat_is_ready (EMPATHY_TP_CHAT (priv->channel_wrapper)))
-    return;
-
-  channel_wrapper_ready (self);
-}
-
 static void
 empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
   const GError *error, gpointer user_data)
@@ -465,19 +439,7 @@ empathy_dispatch_operation_channel_ready_cb (TpChannel *channel,
 
   channel_type = tp_channel_get_channel_type_id (channel);
 
-  if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT)
-    {
-      EmpathyTpChat *chat= empathy_tp_chat_new (channel);
-      priv->channel_wrapper = G_OBJECT (chat);
-
-      if (!empathy_tp_chat_is_ready (chat))
-        {
-          priv->ready_handler = g_signal_connect (chat, "notify::ready",
-            G_CALLBACK (empathy_dispatcher_operation_tp_chat_ready_cb), self);
-          goto out;
-        }
-    }
-  else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
+  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);
index 332fd5033b3627ab6c5db9297ab14189f8eaf3dd..7b7aa1a93159359f42b3185d2744aa9c27322984 100644 (file)
@@ -364,31 +364,12 @@ setup_dispatcher (void)
     const gchar *channeltype;
     TpHandleType handletype;
   } types[] = {
-    /* Text channels with handle types none, contact and room */
-    { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_NONE  },
-    { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT  },
-    { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM  },
     /* file transfer to contacts */
     { TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_HANDLE_TYPE_CONTACT  },
   };
   GHashTable *asv;
   guint i;
 
-  /* Setup the basic Client.Handler that matches our client filter */
-  filters = g_ptr_array_new ();
-  asv = tp_asv_new (
-        TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING,
-           TP_IFACE_CHANNEL_TYPE_TEXT,
-        TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_INT,
-            TP_HANDLE_TYPE_CONTACT,
-        NULL);
-  g_ptr_array_add (filters, asv);
-
-  d = empathy_dispatcher_new (PACKAGE_NAME, filters, NULL);
-
-  g_ptr_array_foreach (filters, (GFunc) g_hash_table_destroy, NULL);
-  g_ptr_array_free (filters, TRUE);
-
   /* 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++)
@@ -401,8 +382,7 @@ setup_dispatcher (void)
       g_ptr_array_add (filters, asv);
     }
 
-  empathy_dispatcher_add_handler (d, PACKAGE_NAME"MoreThanMeetsTheEye",
-    filters, NULL);
+  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);