aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:12:16 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:12:16 +0800
commitbd22bdcc0c16b51e460650ce70bac49065de9c29 (patch)
treec750474be7546b7fda0c5ca0ef1820ab7b056501 /src/empathy.c
parentde7f1fe51aed7cb5b81d85d6bbb73d50b4f7de0b (diff)
downloadgsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar.gz
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar.bz2
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar.lz
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar.xz
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.tar.zst
gsoc2013-empathy-bd22bdcc0c16b51e460650ce70bac49065de9c29.zip
Initial port to the new dispatcher
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2132
Diffstat (limited to 'src/empathy.c')
-rw-r--r--src/empathy.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/empathy.c b/src/empathy.c
index 412c1efa6..65f4ec51b 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -40,6 +40,7 @@
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-dispatcher.h>
+#include <libempathy/empathy-dispatch-operation.h>
#include <libempathy/empathy-tp-chat.h>
#include <libempathy/empathy-tp-group.h>
@@ -62,19 +63,21 @@
static BaconMessageConnection *connection = NULL;
static void
-dispatch_channel_cb (EmpathyDispatcher *dispatcher,
- TpChannel *channel,
+dispatch_cb (EmpathyDispatcher *dispatcher,
+ EmpathyDispatchOperation *operation,
gpointer user_data)
{
- const gchar *channel_type;
+ GQuark channel_type;
- channel_type = tp_channel_get_channel_type (channel);
- if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT)) {
+ channel_type = empathy_dispatch_operation_get_channel_type_id (operation);
+
+ if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT) {
EmpathyTpChat *tp_chat;
EmpathyChat *chat = NULL;
const gchar *id;
- tp_chat = empathy_tp_chat_new (channel);
+ tp_chat = EMPATHY_TP_CHAT (
+ empathy_dispatch_operation_get_channel_wrapper (operation));
empathy_run_until_ready (tp_chat);
id = empathy_tp_chat_get_id (tp_chat);
@@ -102,7 +105,10 @@ dispatch_channel_cb (EmpathyDispatcher *dispatcher,
empathy_chat_window_present_chat (chat);
g_object_unref (tp_chat);
+
+ empathy_dispatch_operation_claim (operation);
}
+#if 0
else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) {
empathy_call_window_new (channel);
}
@@ -115,6 +121,7 @@ dispatch_channel_cb (EmpathyDispatcher *dispatcher,
empathy_ft_manager_add_tp_file (ft_manager, tp_file);
g_object_unref (tp_file);
}
+#endif
}
static void
@@ -502,10 +509,8 @@ main (int argc, char *argv[])
}
/* Handle channels */
- dispatcher = empathy_dispatcher_new ();
- g_signal_connect (dispatcher, "dispatch-channel",
- G_CALLBACK (dispatch_channel_cb),
- NULL);
+ dispatcher = empathy_get_dispatcher ();
+ g_signal_connect (dispatcher, "dispatch", G_CALLBACK (dispatch_cb), NULL);
gtk_main ();