diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:16:22 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:16:22 +0800 |
commit | 571ae9622f8e9bfda7cc248c82c288c2164832fd (patch) | |
tree | 144d5d5f3abfa2dc574e3c570eee0f0a3ede4722 | |
parent | db8a45489640b5e911b0336a9867e7b698433889 (diff) | |
download | gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar.gz gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar.bz2 gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar.lz gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar.xz gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.tar.zst gsoc2013-empathy-571ae9622f8e9bfda7cc248c82c288c2164832fd.zip |
Added a proper Empathy event for an incoming file transfer so that the status icon flashes. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1777
-rw-r--r-- | src/empathy-event-manager.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 3d4ec5e99..75096b4a2 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -178,6 +178,17 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat, } static void +event_channel_file_process_func (EventPriv *event) +{ + EmpathyFTManager *manager; + EmpathyTpFile *tp_file = (EmpathyTpFile *) event->user_data; + + manager = empathy_ft_manager_get_default (); + empathy_ft_manager_add_tp_file (manager, tp_file); + event_remove (event); +} + +static void event_manager_filter_channel_cb (EmpathyDispatcher *dispatcher, TpChannel *channel, EmpathyEventManager *manager) @@ -227,17 +238,29 @@ event_manager_filter_channel_cb (EmpathyDispatcher *dispatcher, NULL); /* Only deal with incoming channels */ - if (g_value_get_uint (direction) == EMP_FILE_TRANSFER_DIRECTION_INCOMING) { - EmpathyFTManager *manager; - McAccount *account; - EmpathyTpFile *tp_file; + if (g_value_get_uint (direction) == + EMP_FILE_TRANSFER_DIRECTION_INCOMING) { + EmpathyContact *contact; + gchar *msg; + McAccount *account; + EmpathyTpFile *tp_file; - manager = empathy_ft_manager_get_default (); account = empathy_channel_get_account (channel); - tp_file = empathy_tp_file_new (account, channel); - empathy_ft_manager_add_tp_file (manager, tp_file); + contact = empathy_tp_file_get_contact (tp_file); + + msg = g_strdup_printf (_("Incoming file transfer from %s"), + empathy_contact_get_name (contact)); + + event_manager_add (manager, contact, + EMPATHY_IMAGE_DOCUMENT_SEND, + msg, + channel, + event_channel_file_process_func, + tp_file); + + g_free (msg); } g_value_unset (direction); |