summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-07-06 16:50:08 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-07-09 18:13:24 +0100
commit54f4fd22c09a342bb58da978b5a055e45f968897 (patch)
tree85ffa46041996618dc66679f0c9f2491bd845e66
parentc8ae24ffd03297d097b553997eda3807f1505748 (diff)
downloadtelepathy-mission-control-54f4fd22c09a342bb58da978b5a055e45f968897.tar.gz
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@collabora.co.uk>
-rw-r--r--src/mcd-dispatcher.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 6a675ddb..3abbd388 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;