[telepathy-mission-control/master] dispatch_operation_claim, mcd_dispatch_operation_check_handle_with: disallow Claim, HandleWith if someone else already approved
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Oct 27 15:11:36 PDT 2009
This is temporary, until fd.o#21003 is fixed...
---
src/mcd-dispatch-operation.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 44a9daf..6ef0411 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -621,10 +621,11 @@ dispatch_operation_claim (TpSvcChannelDispatchOperation *cdo,
McdDispatchOperation *self = MCD_DISPATCH_OPERATION (cdo);
McdDispatchOperationPrivate *priv = self->priv;
- if (priv->wants_to_finish)
+ if (self->priv->wants_to_finish ||
+ !g_queue_is_empty (self->priv->approvals))
{
GError *error = g_error_new (TP_ERRORS, TP_ERROR_NOT_YOURS,
- "CDO already finished (or trying to)");
+ "CDO already finished or approved");
DEBUG ("Giving error to %s: %s", dbus_g_method_get_sender (context),
error->message);
dbus_g_method_return_error (context, error);
@@ -1196,11 +1197,12 @@ mcd_dispatch_operation_check_handle_with (McdDispatchOperation *self,
{
g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE);
- if (self->priv->wants_to_finish)
+ if (self->priv->wants_to_finish ||
+ !g_queue_is_empty (self->priv->approvals))
{
- DEBUG ("NotYours: already finished");
+ DEBUG ("NotYours: already finished or approved");
g_set_error (error, TP_ERRORS, TP_ERROR_NOT_YOURS,
- "CDO already finished");
+ "CDO already finished or approved");
return FALSE;
}
--
1.5.6.5
More information about the telepathy-commits
mailing list