aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-11-14 17:37:47 -0500
committerdaurnimator <quae@daurnimator.com>2014-11-14 17:37:47 -0500
commit0641ba5a3f62447bbaee7f9faa6393bdaf46ed56 (patch)
treefc447cdc1bd93aaed49f9854c1919ef9c9bdd1af /plugins
parentd9a23dce5cc1c5bf908acca970369bb393ec1a1b (diff)
downloadprosody-0641ba5a3f62447bbaee7f9faa6393bdaf46ed56.tar.gz
prosody-0641ba5a3f62447bbaee7f9faa6393bdaf46ed56.zip
plugins/muc/muc.lib: Allow muc-broadcast-presence event listeners to modify nick, actor, reason
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 9f83af80..75caa233 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -198,13 +198,20 @@ function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason
base_presence = base_presence or st.presence {from = occupant.nick; type = "unavailable";};
-- Fire event (before full_p and anon_p are created)
- module:fire_event("muc-broadcast-presence", {
+ local event = {
room = self; stanza = base_presence; x = base_x;
occupant = occupant; nick = nick; actor = actor;
reason = reason;
- });
+ }
+ module:fire_event("muc-broadcast-presence", event);
+
+ -- Allow muc-broadcast-presence listeners to change things
+ nick = event.nick;
+ actor = event.actor;
+ reason = event.reason;
local whois = self:get_whois();
+
local actor_nick;
if actor then
actor_nick = select(3, jid_split(self:get_occupant_jid(actor)));