Mercurial > hg
changeset 1647:cfa1fff86f78
Reorder processing in handle_iq()
There's no need to call the get/set handler functions if we receive an error
IQ message.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 04 Nov 2009 22:24:05 +0100 |
parents | 472cd6ac20fa |
children | 63d8473df2c3 |
files | mcabber/src/xmpp.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mcabber/src/xmpp.c Wed Nov 04 22:18:31 2009 +0100 +++ b/mcabber/src/xmpp.c Wed Nov 04 22:24:05 2009 +0100 @@ -1413,6 +1413,11 @@ LmMessageNode *x; LmMessageSubType mstype = lm_message_get_sub_type(m); + if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { + display_server_error(lm_message_node_get_child(m->node, "error")); + return LM_HANDLER_RESULT_REMOVE_MESSAGE; + } + for (x = m->node->children; x; x=x->next) { xmlns = lm_message_node_get_attribute(x, "xmlns"); if (xmlns) @@ -1422,11 +1427,6 @@ xmlns = NULL; } - if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { - display_server_error(lm_message_node_get_child(m->node, "error")); - return LM_HANDLER_RESULT_REMOVE_MESSAGE; - } - if ((mstype == LM_MESSAGE_SUB_TYPE_SET) || (mstype == LM_MESSAGE_SUB_TYPE_GET)) send_iq_error(connection, m, XMPP_ERROR_NOT_IMPLEMENTED);