Changeset

5086:1ef9aa0c9fb0

MUC: Fix a traceback caused by private IQ result and error stanzas where the encoded id can't be processed.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 09 Aug 2012 07:17:25 +0500
parents 5085:cbc7eb5cfa8c
children 5088:d5bb9cd2e6df
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Wed Aug 08 11:49:31 2012 +0100
+++ b/plugins/muc/muc.lib.lua	Thu Aug 09 07:17:25 2012 +0500
@@ -525,7 +525,9 @@
 		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 @@
 				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;