diff options
author | Maxime ?pep? Buquet <pep@bouah.net> | 2020-02-24 14:16:45 +0100 |
---|---|---|
committer | Maxime ?pep? Buquet <pep@bouah.net> | 2020-02-24 14:16:45 +0100 |
commit | d7348a322667f5c60d0de1e425dd4cf13c203766 (patch) | |
tree | 4e8f10e1202988dac0b787ec31ee971a4e4dfeed /plugins/muc | |
parent | 6dc942c5cecda6b09caf062289a0b9dbfeeee3e0 (diff) | |
download | prosody-d7348a322667f5c60d0de1e425dd4cf13c203766.tar.gz prosody-d7348a322667f5c60d0de1e425dd4cf13c203766.zip |
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.
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/muc.lib.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 399b090e..8adb0046 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -814,7 +814,9 @@ function room_mt:handle_message_to_occupant(origin, stanza) 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; |