diff options
author | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2009-09-21 16:21:17 +0100 |
---|---|---|
committer | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2009-09-21 17:44:54 +0100 |
commit | 9b3de37e9b99af2abaf4cee045ba42a548d970b2 (patch) | |
tree | 1f3b17dfae50148b16e738a638f12f16b8cd299c /tests/wocky-test-connector-server.c | |
parent | 252c938262d0ddab12fff62c226700354a8f11cf (diff) |
Make sure we include the username in the jabber auth iq get stanza.
Diffstat (limited to 'tests/wocky-test-connector-server.c')
-rw-r--r-- | tests/wocky-test-connector-server.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/wocky-test-connector-server.c b/tests/wocky-test-connector-server.c index bdee7de..7977b4a 100644 --- a/tests/wocky-test-connector-server.c +++ b/tests/wocky-test-connector-server.c @@ -476,6 +476,10 @@ iq_get_query_JABBER_AUTH (TestConnectorServer *self, WockyXmppStanza *iq = NULL; WockyXmppNode *env = xml->node; const gchar *id = wocky_xmpp_node_get_attribute (env, "id"); + WockyXmppNode *query = wocky_xmpp_node_get_child (env, "query"); + WockyXmppNode *user = (query != NULL) ? + wocky_xmpp_node_get_child (query, "username") : NULL; + const gchar *name = (user != NULL) ? user->content : NULL; DEBUG (""); if (priv->problem.connector->jabber & JABBER_PROBLEM_AUTH_NIH) @@ -490,6 +494,18 @@ iq_get_query_JABBER_AUTH (TestConnectorServer *self, WOCKY_NODE_END, WOCKY_STANZA_END); } + else if (name == NULL || *name == '\0') + { + iq = wocky_xmpp_stanza_build (WOCKY_STANZA_TYPE_IQ, + WOCKY_STANZA_SUB_TYPE_ERROR, + NULL, NULL, + WOCKY_NODE_ATTRIBUTE, "id", id, + WOCKY_NODE, "error", WOCKY_NODE_ATTRIBUTE, "type", "modify", + WOCKY_NODE, "not-acceptable", + WOCKY_NODE_XMLNS, WOCKY_XMPP_NS_STANZAS, + WOCKY_NODE_END, + WOCKY_STANZA_END); + } else if (priv->mech != NULL) { iq = wocky_xmpp_stanza_build (WOCKY_STANZA_TYPE_IQ, |