aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:12:40 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:12:40 +0800
commit6fb143b09acd744811883c4f1177a843ec60daaf (patch)
treeffbb2cd2f12640cf88dd9970fa869e8d2a9a7b48 /src
parentab79229c96c0abff467dfd47edf01c18cbbae749 (diff)
downloadgsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar.gz
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar.bz2
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar.lz
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar.xz
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.tar.zst
gsoc2013-empathy-6fb143b09acd744811883c4f1177a843ec60daaf.zip
Enable approving of file transfers
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2138
Diffstat (limited to 'src')
-rw-r--r--src/empathy-event-manager.c72
1 files changed, 37 insertions, 35 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 72417328b..d88d0b0cd 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -239,25 +239,25 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
channel_type = empathy_dispatch_operation_get_channel_type (operation);
+ approval = event_manager_approval_new (manager, operation);
+ priv->approvals = g_slist_prepend (priv->approvals, approval);
+
+ approval->approved_handler = g_signal_connect (operation, "approved",
+ G_CALLBACK (event_manager_operation_approved_cb), approval);
+
+ approval->claimed_handler = g_signal_connect (operation, "claimed",
+ G_CALLBACK (event_manager_operation_claimed_cb), approval);
+
if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT))
{
EmpathyTpChat *tp_chat =
EMPATHY_TP_CHAT (
empathy_dispatch_operation_get_channel_wrapper (operation));
- approval = event_manager_approval_new (manager, operation);
- priv->approvals = g_slist_prepend (priv->approvals, approval);
-
g_signal_connect (tp_chat, "message-received",
G_CALLBACK (event_manager_chat_message_received_cb), approval);
g_object_unref (G_OBJECT (tp_chat));
- approval->approved_handler = g_signal_connect (operation, "approved",
- G_CALLBACK (event_manager_operation_approved_cb), approval);
-
- approval->claimed_handler = g_signal_connect (operation, "claimed",
- G_CALLBACK (event_manager_operation_claimed_cb), approval);
-
}
#if 0
else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) {
@@ -282,38 +282,40 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
g_object_unref (contact);
g_object_unref (tp_group);
}
- else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) {
- EmpathyContact *contact;
- gchar *msg;
- TpHandle handle;
- McAccount *account;
- EmpathyContactFactory *factory;
-
- factory = empathy_contact_factory_dup_singleton ();
- handle = tp_channel_get_handle (channel, NULL);
- account = empathy_channel_get_account (channel);
+#endif
+ else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER))
+ {
+ EmpathyContact *contact;
+ gchar *msg;
+ TpHandle handle;
+ McAccount *account;
+ EmpathyContactFactory *factory;
+ TpChannel *channel = empathy_dispatch_operation_get_channel (operation);
- contact = empathy_contact_factory_get_from_handle (factory,
- account,
- handle);
+ factory = empathy_contact_factory_dup_singleton ();
+ handle = tp_channel_get_handle (channel, NULL);
+ account = empathy_channel_get_account (channel);
- empathy_contact_run_until_ready (contact,
- EMPATHY_CONTACT_READY_NAME, NULL);
+ contact = empathy_contact_factory_get_from_handle (factory, account,
+ handle);
- msg = g_strdup_printf (_("Incoming file transfer from %s"),
- empathy_contact_get_name (contact));
+ empathy_contact_run_until_ready (contact,
+ EMPATHY_CONTACT_READY_NAME, NULL);
- event_manager_add (manager, contact,
- EMPATHY_IMAGE_DOCUMENT_SEND,
- msg, channel,
- event_channel_process_func, NULL);
+ msg = g_strdup_printf (_("Incoming file transfer from %s"),
+ empathy_contact_get_name (contact));
- g_object_unref (factory);
- g_object_unref (account);
- }
+ event_manager_add (manager, contact, EMPATHY_IMAGE_DOCUMENT_SEND,
+ msg, approval, event_channel_process_func, NULL);
- g_free (channel_type);
-#endif
+ g_object_unref (channel);
+ g_object_unref (factory);
+ g_object_unref (account);
+ }
+ else
+ {
+ DEBUG ("Unknown channel type, ignoring..");
+ }
}
#if 0 /* FIXME dispatcher */