[telepathy-mission-control-5.12] telepathy-mission-control: dispatcher: set channel state back to DISPATCHED after delegating & presenting
Jonny Lamb
jonny at kemper.freedesktop.org
Mon Jul 9 10:13:45 PDT 2012
Module: telepathy-mission-control
Branch: telepathy-mission-control-5.12
Commit: 54f4fd22c09a342bb58da978b5a055e45f968897
URL: http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=54f4fd22c09a342bb58da978b5a055e45f968897
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: Fri Jul 6 16:50:08 2012 +0100
dispatcher: set channel state back to DISPATCHED after delegating & presenting
_mcd_client_proxy_handle_channels sets the McdChannel state to
HANDLER_INVOKED, but when we were calling this in both delegate and
present operations, the state was not being set back to the DISPATCHED
state afterwards.
The state being wrong meant that dispatching a channel after if had
been delegated or presented would not happen, as MC thought we were
still waiting for a handler response.
Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
src/mcd-dispatcher.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 6a675dd..3abbd38 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -2584,6 +2584,13 @@ delegate_channels_cb (TpClient *client,
DelegateChannelsCtx *ctx = to_delegate->ctx;
McdClientProxy *clt_proxy = MCD_CLIENT_PROXY (client);
+ /* If the delegation succeeded, the channel has a new handler. If
+ * the delegation failed, the channel still has the old
+ * handler. Either way, the channel still has a handler, so it has
+ * been successfully dispatched (from 'handler invoked'). */
+ _mcd_channel_set_status (to_delegate->channel,
+ MCD_CHANNEL_STATUS_DISPATCHED);
+
if (error != NULL)
{
DEBUG ("Handler refused delegated channels");
@@ -2821,10 +2828,17 @@ error:
static void
present_handle_channels_cb (TpClient *client,
const GError *error,
- gpointer user_data G_GNUC_UNUSED,
+ gpointer user_data,
GObject *weak_object)
{
DBusGMethodInvocation *context = user_data;
+ McdChannel *mcd_channel = MCD_CHANNEL (weak_object);
+
+ /* Whether presenting the channel succeeded or failed, the
+ * channel's handler hasn't been altered, so it must be set back
+ * to the dispatched state (from 'handler invoked'). */
+ _mcd_channel_set_status (mcd_channel,
+ MCD_CHANNEL_STATUS_DISPATCHED);
if (error != NULL)
{
@@ -2893,7 +2907,7 @@ dispatcher_present_channel (
_mcd_client_proxy_handle_channels (client, -1, channels,
user_action_time, NULL, present_handle_channels_cb,
- context, NULL, NULL);
+ context, NULL, G_OBJECT (mcd_channel));
g_list_free (channels);
return;
More information about the telepathy-commits
mailing list