empathy r1777 - trunk/src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1777 - trunk/src
- Date: Fri, 21 Nov 2008 16:16:22 +0000 (UTC)
Author: xclaesse
Date: Fri Nov 21 16:16:22 2008
New Revision: 1777
URL: http://svn.gnome.org/viewvc/empathy?rev=1777&view=rev
Log:
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>
Modified:
trunk/src/empathy-event-manager.c
Modified: trunk/src/empathy-event-manager.c
==============================================================================
--- trunk/src/empathy-event-manager.c (original)
+++ trunk/src/empathy-event-manager.c Fri Nov 21 16:16:22 2008
@@ -178,6 +178,17 @@
}
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 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]