Reorder processing in handle_iq()
There's no need to call the get/set handler functions if we receive an error
IQ message.
--- 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);