From 64e6014e9cf6b2038126fc5288dc398d59acbbb1 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 21 Nov 2008 16:15:06 +0000 Subject: Handle incoming file transfers in the event manager. (Jonny Lamb) Signed-off-by: Jonny Lamb svn path=/trunk/; revision=1757 --- src/empathy-event-manager.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 618706f1c..712b33b5c 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -31,6 +31,9 @@ #include #include #include +#include + +#include #include #include @@ -212,6 +215,33 @@ event_manager_filter_channel_cb (EmpathyDispatcher *dispatcher, g_object_unref (contact); g_object_unref (tp_group); } + else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_FILE)) { + GValue *direction; + + tp_cli_dbus_properties_run_get (channel, + -1, + EMP_IFACE_CHANNEL_TYPE_FILE, + "Direction", + &direction, + NULL, + NULL); + + /* Only deal with incoming channels */ + if (g_value_get_uint (direction) == EMP_FILE_TRANSFER_DIRECTION_INCOMING) { + EmpathyFTManager *manager; + McAccount *account; + EmpathyFile *file; + + manager = empathy_ft_manager_get_default (); + account = empathy_channel_get_account (channel); + + file = empathy_file_new (account, channel); + + empathy_ft_manager_add_file (manager, file); + } + + g_value_unset (direction); + } g_free (channel_type); } -- cgit v1.2.3