diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-11 21:10:54 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-11 21:10:54 +0800 |
commit | 419d09c664b17192447a027c5f5da66a8853120f (patch) | |
tree | 12fca77fe1e1273c78ffd5fc30e4711bbd5925ea /libempathy/empathy-chandler.c | |
parent | eb5dd07b401c157588592445c641f94403cdd601 (diff) | |
download | gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar.gz gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar.bz2 gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar.lz gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar.xz gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.tar.zst gsoc2013-empathy-419d09c664b17192447a027c5f5da66a8853120f.zip |
Chandler and Filter only dispatch ready TpChannel
svn path=/trunk/; revision=902
Diffstat (limited to 'libempathy/empathy-chandler.c')
-rw-r--r-- | libempathy/empathy-chandler.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/libempathy/empathy-chandler.c b/libempathy/empathy-chandler.c index 9dd6bfdb0..8e2637718 100644 --- a/libempathy/empathy-chandler.c +++ b/libempathy/empathy-chandler.c @@ -24,8 +24,8 @@ #include <dbus/dbus-glib.h> #include <telepathy-glib/dbus.h> -#include <libtelepathy/tp-conn.h> -#include <libtelepathy/tp-chan.h> +#include <telepathy-glib/connection.h> +#include <telepathy-glib/channel.h> #include "empathy-chandler.h" #include "empathy-debug.h" @@ -62,9 +62,9 @@ empathy_chandler_class_init (EmpathyChandlerClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, - _empathy_marshal_VOID__OBJECT_OBJECT, + g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, - 2, TELEPATHY_CONN_TYPE, TELEPATHY_CHAN_TYPE); + 1, TP_TYPE_CHANNEL); } static void @@ -126,32 +126,25 @@ empathy_chandler_handle_channel (EmpathyChandler *chandler, guint handle, GError **error) { - TpChan *tp_chan; - TpConn *tp_conn; - - tp_conn = tp_conn_new_without_connect (tp_get_bus (), - bus_name, - connection, - NULL, - error); - if (!tp_conn) { - return FALSE; + TpChannel *chan; + TpConnection *conn; + static TpDBusDaemon *daemon = NULL; + + if (!daemon) { + daemon = tp_dbus_daemon_new (tp_get_bus ()); } - tp_chan = tp_chan_new (tp_get_bus(), - bus_name, - channel, - channel_type, - handle_type, - handle); + conn = tp_connection_new (daemon, bus_name, connection, NULL); + chan = tp_channel_new (conn, channel, channel_type, handle_type, handle, NULL); + tp_channel_run_until_ready (chan, NULL, NULL); empathy_debug (DEBUG_DOMAIN, "New channel to be handled: " "type=%s handle=%d", channel_type, handle); - g_signal_emit (chandler, signals[NEW_CHANNEL], 0, tp_conn, tp_chan); + g_signal_emit (chandler, signals[NEW_CHANNEL], 0, chan); - g_object_unref (tp_chan); - g_object_unref (tp_conn); + g_object_unref (chan); + g_object_unref (conn); return TRUE; } |