Software /
code /
prosody
Comparison
core/modulemanager.lua @ 608:3758af511ce8
Don't try processing stanzas not of type get or set in module manager
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 08 Dec 2008 21:06:41 +0500 |
parent | 592:c6e2c727d0cc |
child | 615:4ae3e81513f3 |
comparison
equal
deleted
inserted
replaced
607:7d1493fc524a | 608:3758af511ce8 |
---|---|
121 end | 121 end |
122 | 122 |
123 function handle_stanza(host, origin, stanza) | 123 function handle_stanza(host, origin, stanza) |
124 local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns, origin.type; | 124 local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns, origin.type; |
125 if name == "iq" and xmlns == "jabber:client" then | 125 if name == "iq" and xmlns == "jabber:client" then |
126 xmlns = stanza.tags[1].attr.xmlns; | 126 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
127 log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns); | 127 xmlns = stanza.tags[1].attr.xmlns; |
128 log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns); | |
129 else | |
130 log("debug", "Discarding %s from %s of type: %s", name, origin_type, stanza.attr.type); | |
131 return true; | |
132 end | |
128 end | 133 end |
129 local handlers = stanza_handlers:get(host, origin_type, name, xmlns); | 134 local handlers = stanza_handlers:get(host, origin_type, name, xmlns); |
130 if handlers then | 135 if handlers then |
131 log("debug", "Passing stanza to mod_%s", handler_info[handlers[1]].name); | 136 log("debug", "Passing stanza to mod_%s", handler_info[handlers[1]].name); |
132 (handlers[1])(origin, stanza); | 137 (handlers[1])(origin, stanza); |