diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-06-03 13:29:08 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-06-03 13:29:08 +0200 |
commit | ec2bc5f7281da572b4ba0f91c63c96950811c09f (patch) | |
tree | e7318a776634d52938c5a5c39228268f175e0ede | |
parent | f6383a5936f6d21572073f01c630c5c3641c2b52 (diff) |
wocky_jingle_state_machine_dance: return a boolean
-rw-r--r-- | wocky/wocky-jingle-session.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/wocky/wocky-jingle-session.c b/wocky/wocky-jingle-session.c index 60933f4..321b221 100644 --- a/wocky/wocky-jingle-session.c +++ b/wocky/wocky-jingle-session.c @@ -1538,19 +1538,28 @@ static HandlerFunc handlers[] = { on_info }; -static void +static gboolean wocky_jingle_state_machine_dance (WockyJingleSession *sess, WockyJingleAction action, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; + GError *e = NULL; /* parser should've checked this already */ g_assert (action_is_allowed (action, priv->state)); g_assert (handlers[action] != NULL); - handlers[action] (sess, node, error); + handlers[action] (sess, node, &e); + + if (e != NULL) + { + g_propagate_error (error, e); + return FALSE; + } + + return TRUE; } static WockyJingleDialect @@ -1671,7 +1680,6 @@ wocky_jingle_session_parse ( WockyJingleSessionPrivate *priv; WockyNode *iq_node, *session_node; const gchar *from, *action_name; - GError *e = NULL; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); g_return_val_if_fail (WOCKY_IS_STANZA (stanza), FALSE); @@ -1735,15 +1743,7 @@ wocky_jingle_session_parse ( return FALSE; } - wocky_jingle_state_machine_dance (sess, action, session_node, &e); - - if (e != NULL) - { - g_propagate_error (error, e); - return FALSE; - } - - return TRUE; + return wocky_jingle_state_machine_dance (sess, action, session_node, error); } WockyStanza * |