summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-06-03 11:29:08 (GMT)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-06-03 11:29:08 (GMT)
commitec2bc5f7281da572b4ba0f91c63c96950811c09f (patch)
treee7318a776634d52938c5a5c39228268f175e0ede
parentf6383a5936f6d21572073f01c630c5c3641c2b52 (diff)
downloadwocky-master.tar.gz
wocky-master.tar.xz
wocky_jingle_state_machine_dance: return a booleanHEADmaster
-rw-r--r--wocky/wocky-jingle-session.c24
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 *