Software /
code /
prosody
Comparison
plugins/muc/muc.lib.lua @ 6272:90054f21d1af
plugins/muc/muc: When forwarding mediated invites; use filtered version of original invite instead of new object
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Thu, 05 Jun 2014 17:08:05 -0400 |
parent | 6269:f89d2dec2977 |
child | 6273:7ef064101994 |
comparison
equal
deleted
inserted
replaced
6271:006b0e0f0de2 | 6272:90054f21d1af |
---|---|
839 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); | 839 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); |
840 return true; | 840 return true; |
841 elseif module:fire_event("muc-pre-invite", {room = self, origin = origin, stanza = stanza}) then | 841 elseif module:fire_event("muc-pre-invite", {room = self, origin = origin, stanza = stanza}) then |
842 return true; | 842 return true; |
843 end | 843 end |
844 local invite = st.message({from = self.jid, to = invitee, id = stanza.attr.id}) | 844 local invite = muc_util.filter_muc_x(st.clone(stanza)); |
845 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}) | 845 invite.attr.from = self.jid; |
846 invite.attr.to = invitee; | |
847 invite:tag('x', {xmlns='http://jabber.org/protocol/muc#user'}) | |
846 :tag('invite', {from = stanza.attr.from;}) | 848 :tag('invite', {from = stanza.attr.from;}) |
847 :tag('reason'):text(payload:get_child_text("reason")):up() | 849 :tag('reason'):text(payload:get_child_text("reason")):up() |
848 :up() | 850 :up() |
849 :up(); | 851 :up(); |
850 if not module:fire_event("muc-invite", {room = self, stanza = invite, origin = origin, incoming = stanza}) then | 852 if not module:fire_event("muc-invite", {room = self, stanza = invite, origin = origin, incoming = stanza}) then |