Comparison

plugins/muc/muc.lib.lua @ 6273:7ef064101994

plugins/muc/muc.lib: Use original decline as template for medated decline
author daurnimator <quae@daurnimator.com>
date Fri, 06 Jun 2014 14:33:43 -0400
parent 6272:90054f21d1af
child 6274:77bdbaec3b7f
comparison
equal deleted inserted replaced
6272:90054f21d1af 6273:7ef064101994
882 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); 882 origin.send(st.error_reply(stanza, "cancel", "jid-malformed"));
883 return true; 883 return true;
884 elseif module:fire_event("muc-pre-decline", {room = self, origin = origin, stanza = stanza}) then 884 elseif module:fire_event("muc-pre-decline", {room = self, origin = origin, stanza = stanza}) then
885 return true; 885 return true;
886 end 886 end
887 local decline = st.message({from = self.jid, to = declinee, id = stanza.attr.id}) 887 local decline = muc_util.filter_muc_x(st.clone(stanza));
888 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) 888 decline.attr.from = self.jid;
889 decline.attr.to = declinee;
890 decline:tag("x", {xmlns = "http://jabber.org/protocol/muc#user"})
889 :tag("decline", {from = stanza.attr.from}) 891 :tag("decline", {from = stanza.attr.from})
890 :tag("reason"):text(payload:get_child_text("reason")):up() 892 :tag("reason"):text(payload:get_child_text("reason")):up()
891 :up() 893 :up()
892 :up(); 894 :up();
893 if not module:fire_event("muc-decline", {room = self, stanza = decline, origin = origin, incoming = stanza}) then 895 if not module:fire_event("muc-decline", {room = self, stanza = decline, origin = origin, incoming = stanza}) then