[telepathy-mission-control/master] McdDispatchOperation: consider it to be approved if no approval was needed

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Oct 20 08:47:18 PDT 2009


This means we don't need to set approved explicitly when creating
requested CDOs.
---
 src/mcd-dispatch-operation.c |    2 +-
 src/mcd-dispatcher.c         |    8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 3214e78..cc9e511 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1040,7 +1040,7 @@ _mcd_dispatch_operation_is_approved (McdDispatchOperation *self)
 {
     g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE);
 
-    return self->priv->approved;
+    return (self->priv->approved || !self->priv->needs_approval);
 }
 
 void
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 39c428f..8bc4806 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1437,14 +1437,8 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher,
     context->operation = _mcd_dispatch_operation_new (priv->clients,
         !requested, channels, (const gchar * const *) possible_handlers);
 
-    if (requested)
+    if (!requested)
     {
-        _mcd_dispatch_operation_set_approved (context->operation);
-    }
-    else
-    {
-        /* McdDispatchOperation defaults to being unapproved */
-
         if (priv->operation_list_active)
         {
             tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation (
-- 
1.5.6.5




More information about the telepathy-commits mailing list