aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2020-02-24 14:16:45 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2020-02-24 14:16:45 +0100
commit4a2e73392898afb5f8b380bdef86e438761b3d77 (patch)
tree4e8f10e1202988dac0b787ec31ee971a4e4dfeed
parentd9c8eeb88981ca0a617e545674105b7b9b3ec4ae (diff)
downloadprosody-4a2e73392898afb5f8b380bdef86e438761b3d77.tar.gz
prosody-4a2e73392898afb5f8b380bdef86e438761b3d77.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.
-rw-r--r--plugins/muc/muc.lib.lua4
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;