summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-01-04 11:22:48 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-01-04 11:22:48 +0000
commit4371e5e46ebd8d6537c9d6ba5106ee8bc703c1b8 (patch)
tree12a22a27cd3787bfcbe2a52c3c1dc7152714edd0
parent36eeb9164dbb631c35efb1405bc6efb1c23c5e77 (diff)
downloadtelepathy-mission-control-4371e5e46ebd8d6537c9d6ba5106ee8bc703c1b8.tar.gz
mcd-dispatch-operation: explicitly cancel calling approvers instead of accidentally
Previously, the "run approvers in an idle" function would be called when an observer returned even if he or she called HandleWith{,Time}. The idle function would set invoked_approvers_if_needed to TRUE and try and run the approvers if needed, followed by checking the client locks again. This made non-interactive approvers implemented as delaying observers work because it wouldn't actually call ADO on approvers due to mcd_dispatch_operation_is_approved returning TRUE, but this way makes the process a little more clear to understand. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--src/mcd-dispatch-operation.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index bd33d8a6..66f152f6 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -518,6 +518,17 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
return;
}
+ else if (approval != NULL && approval->type == APPROVAL_TYPE_HANDLE_WITH)
+ {
+ /* We set this to TRUE so that the handlers are called. */
+ self->priv->invoked_approvers_if_needed = TRUE;
+
+ if (approver_event_id > 0)
+ {
+ DEBUG ("Cancelling call to approvers as dispatch operation has been HandledWith'd");
+ g_source_remove (approver_event_id);
+ }
+ }
if (self->priv->invoked_approvers_if_needed)
{