diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-11-22 00:15:06 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-11-22 00:15:06 +0800 |
commit | 094c9288f0c55f93c4c12347ed6bd3635e0cd7bc (patch) | |
tree | c622372d4b5f1b1ca8e63e31b98c3613720c8e48 /src | |
parent | d3a7394e8f707dd7e8b592c39aa7523be968984f (diff) | |
download | gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar.gz gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar.bz2 gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar.lz gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar.xz gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.tar.zst gsoc2013-empathy-094c9288f0c55f93c4c12347ed6bd3635e0cd7bc.zip |
Handle incoming file transfers in the event manager. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1757 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-event-manager.c | 30 |
1 files changed, 30 insertions, 0 deletions
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 <libempathy/empathy-tp-chat.h> #include <libempathy/empathy-tp-group.h> #include <libempathy/empathy-utils.h> +#include <libempathy/empathy-file.h> + +#include <libempathy-gtk/empathy-ft-manager.h> #include <libempathy-gtk/empathy-images.h> #include <libempathy-gtk/empathy-contact-dialogs.h> @@ -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); } |