diff options
author | Alberto Mardegan <alberto.mardegan@nokia.com> | 2009-01-29 16:55:52 +0200 |
---|---|---|
committer | Alberto Mardegan <alberto.mardegan@nokia.com> | 2009-01-29 16:55:52 +0200 |
commit | b7b8bde02516036f5cc6cfd1c85221ebcca1b7fb (patch) | |
tree | 1a5900e8eefef39d1594767520c8be9f3a4ceda0 | |
parent | 30bbd06799ca93d3cd89e26e7eba8f3ac3edb234 (diff) |
Add the account to the context
It might not be available later, if the channels are aborted.
-rw-r--r-- | src/mcd-dispatcher.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c index afc12fe4..443e8e44 100644 --- a/src/mcd-dispatcher.c +++ b/src/mcd-dispatcher.c @@ -74,6 +74,7 @@ struct _McdDispatcherContext GList *channels; McdChannel *main_channel; + McdAccount *account; McdDispatchOperation *operation; /* This variable is the count of locks that must be removed before handlers @@ -1626,12 +1627,20 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher, McdDispatcherPrivate *priv; GList *chain, *list; McdChannel *channel; + McdAccount *account; guint n_channels; g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_return_if_fail (channels != NULL); g_return_if_fail (MCD_IS_CHANNEL (channels->data)); + account = mcd_channel_get_account (channels->data); + if (G_UNLIKELY (!account)) + { + g_warning ("%s called with no account", G_STRFUNC); + return; + } + priv = dispatcher->priv; /* old-style filters cannot probably handle more than one channel; so, @@ -1667,6 +1676,7 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher, context = g_new0 (McdDispatcherContext, 1); context->ref_count = 1; context->dispatcher = dispatcher; + context->account = account; context->channels = channels; context->chain = chain; if (!requested) |