MUC: Fix a traceback caused by private IQ result and error stanzas where the encoded...
authorWaqas Hussain <waqas20@gmail.com>
Thu, 9 Aug 2012 02:17:25 +0000 (07:17 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Thu, 9 Aug 2012 02:17:25 +0000 (07:17 +0500)
plugins/muc/muc.lib.lua

index ae6b8e549f23494b4500bcac558c858a4c11fb5e..a7603535910007f9b6c0a31ad18488796115bdb3 100644 (file)
@@ -525,7 +525,9 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
                if type == "error" or type == "result" and stanza.name == "iq" then
                        local id = stanza.attr.id;
                        stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza);
-                       self:_route_stanza(stanza);
+                       if stanza.attr.id then
+                               self:_route_stanza(stanza);
+                       end
                        stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id;
                else
                        origin.send(st.error_reply(stanza, "cancel", "not-acceptable"));
@@ -549,7 +551,9 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
                                if type == 'get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then
                                        stanza.attr.to = jid_bare(stanza.attr.to);
                                end
-                               self:_route_stanza(stanza);
+                               if stanza.attr.id then
+                                       self:_route_stanza(stanza);
+                               end
                                stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id;
                        else -- message
                                stanza.attr.from = current_nick;