MUC: Fix private IQ results and errors for non-vcard queries.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 04 Aug 2012 23:22:16 +0500
changeset 5078 cba0b426b542
parent 5077 6c2c8bf36d22
child 5079 2ab99e239d45
MUC: Fix private IQ results and errors for non-vcard queries.
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Fri Aug 03 14:07:41 2012 +0100
+++ b/plugins/muc/muc.lib.lua	Sat Aug 04 23:22:16 2012 +0500
@@ -541,7 +541,11 @@
 			log("debug", "%s sent private stanza to %s (%s)", from, to, o_data.jid);
 			if stanza.name == "iq" then
 				local id = stanza.attr.id;
-				stanza.attr.from, stanza.attr.to, stanza.attr.id = construct_stanza_id(self, stanza);
+				if stanza.attr.type == "get" or stanza.attr.type == "set" then
+					stanza.attr.from, stanza.attr.to, stanza.attr.id = construct_stanza_id(self, stanza);
+				else
+					stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza);
+				end
 				if type == 'get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then
 					stanza.attr.to = jid_bare(stanza.attr.to);
 				end