aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-02-21 06:51:11 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-02-21 06:51:11 +0800
commit1a0c4d402c2eef53366037b75292e9dc32eeb288 (patch)
treeaeb094a85349d4fa1fa0187a58c7baeb2b2c2606
parent07a5cbcf40dfeb175e2c8f269d92ac236d989d31 (diff)
downloadgsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar.gz
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar.bz2
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar.lz
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar.xz
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.tar.zst
gsoc2013-empathy-1a0c4d402c2eef53366037b75292e9dc32eeb288.zip
Handle re-dispatching channels in approving state
when a channel is in approving state and the user does a request which turns out to be satisfied by that channel it automagically gets approved. Correctly cope with this and don't try to start dispatching for it again. Fixes bug Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2524
-rw-r--r--libempathy/empathy-dispatcher.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 38eb71a9e..b3fd6a8a2 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -1120,11 +1120,21 @@ dispatcher_connection_new_requested_channel (EmpathyDispatcher *dispatcher,
request_data->operation = operation;
- /* (pre)-approve this right away as we requested it */
+ /* (pre)-approve this right away as we requested it
+ * This might cause the channel to be claimed, in which case the operation
+ * will disappear. So ref it, and check the status before starting the
+ * dispatching */
+
+ g_object_ref (operation);
empathy_dispatch_operation_approve (operation);
- dispatcher_start_dispatching (request_data->dispatcher, operation,
- conn_data);
+ if (empathy_dispatch_operation_get_status (operation) <
+ EMPATHY_DISPATCHER_OPERATION_STATE_APPROVING)
+ dispatcher_start_dispatching (request_data->dispatcher, operation,
+ conn_data);
+
+ g_object_unref (operation);
+
out:
dispatcher_flush_outstanding_operations (request_data->dispatcher,
conn_data);