# HG changeset patch # User Maxime “pep” Buquet # Date 1582550205 -3600 # Node ID 46373b97e648472ed74573dcdcf8dff914d5af7e # Parent 4eee1aaa9405eda8535531d1e7d61aadb93befbc mod_muc: add muc-private-message event This seems to be the one place handling MUC-PMs. This event is added so that plugins (such as muc_occupant_id) can edit them without having to redo the work. diff -r 4eee1aaa9405 -r 46373b97e648 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Mon Feb 24 09:10:28 2020 +0100 +++ b/plugins/muc/muc.lib.lua Mon Feb 24 14:16:45 2020 +0100 @@ -814,7 +814,9 @@ stanza = muc_util.filter_muc_x(st.clone(stanza)); stanza:tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }):up(); stanza.attr.from = current_nick; - self:route_to_occupant(o_data, stanza) + if module:fire_event("muc-private-message", { room = self, origin = origin, stanza = stanza }) ~= false then + self:route_to_occupant(o_data, stanza) + end -- TODO: Remove x tag? stanza.attr.from = from; return true;