[Telepathy-commits] [telepathy-mission-control/master] Skip approval if the incoming channel is requested.

Alberto Mardegan alberto.mardegan at nokia.com
Fri Jan 30 04:03:33 PST 2009


If approvers have yet to be invoked when the incoming channel is requested, we
can just skip them.
---
 src/mcd-dispatcher.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index b99f753..bd89d04 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -73,6 +73,11 @@ struct _McdDispatcherContext
     /* If this flag is TRUE, dispatching must be cancelled ASAP */
     guint cancelled : 1;
 
+    /* This is set to TRUE if the incoming channel being dispatched has being
+     * requested before the approvers could be run; in that case, the approval
+     * phase should be skipped */
+    guint skip_approval : 1;
+
     McdDispatcher *dispatcher;
 
     GList *channels;
@@ -1531,7 +1536,8 @@ mcd_dispatcher_run_clients (McdDispatcherContext *context)
          * requested: start the Approvers */
 
         /* but if the handlers have the BypassApproval flag set, then don't */
-        if (!handlers_can_bypass_approval (context))
+        if (!context->skip_approval &&
+            !handlers_can_bypass_approval (context))
             mcd_dispatcher_run_approvers (context);
     }
 
@@ -3148,6 +3154,8 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
                     mcd_dispatch_operation_handle_with (context->operation,
                                                         NULL, NULL);
             }
+            else
+                context->skip_approval = TRUE;
         }
         g_debug ("channel %p is proxying %p", request, channel);
         _mcd_channel_set_request_proxy (request, channel);
-- 
1.5.6.5




More information about the telepathy-commits mailing list