# HG changeset patch # User daurnimator # Date 1416004667 18000 # Node ID 3bbd59c03aebf8e3cd8a8ecf53340e65d93e0406 # Parent ad159be9e9d708d7a3831a8e360011860db14658 plugins/muc/muc.lib: Allow muc-broadcast-presence event listeners to modify nick, actor, reason diff -r ad159be9e9d7 -r 3bbd59c03aeb plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Tue Nov 11 13:08:34 2014 -0500 +++ b/plugins/muc/muc.lib.lua Fri Nov 14 17:37:47 2014 -0500 @@ -198,13 +198,20 @@ 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)));