plugins/muc/muc: When forwarding mediated invites; use filtered version of original invite instead of new object
authordaurnimator <quae@daurnimator.com>
Thu, 05 Jun 2014 17:08:05 -0400
changeset 6272 90054f21d1af
parent 6271 006b0e0f0de2
child 6273 7ef064101994
plugins/muc/muc: When forwarding mediated invites; use filtered version of original invite instead of new object
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Thu Jun 05 17:07:14 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Thu Jun 05 17:08:05 2014 -0400
@@ -841,8 +841,10 @@
 	elseif module:fire_event("muc-pre-invite", {room = self, origin = origin, stanza = stanza}) then
 		return true;
 	end
-	local invite = st.message({from = self.jid, to = invitee, id = stanza.attr.id})
-		:tag('x', {xmlns='http://jabber.org/protocol/muc#user'})
+	local invite = muc_util.filter_muc_x(st.clone(stanza));
+	invite.attr.from = self.jid;
+	invite.attr.to = invitee;
+	invite:tag('x', {xmlns='http://jabber.org/protocol/muc#user'})
 			:tag('invite', {from = stanza.attr.from;})
 				:tag('reason'):text(payload:get_child_text("reason")):up()
 			:up()