From 8728ee5e5a3925588e5502a87a3466ec8eebc44a Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 5 Sep 2014 11:28:28 -0400 Subject: plugins/muc/muc.lib: Add muc-set-affiliation event --- plugins/muc/muc.lib.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'plugins/muc') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 31b5c559..4e461df6 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1049,6 +1049,17 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason) end if self.save then self:save(); end + + module:fire_event("muc-set-affiliation", { + room = self; + actor = actor; + jid = jid; + affiliation = affiliation or "none"; + reason = reason; + previous_affiliation = target_affiliation; + in_room = next(occupants_updated) ~= nil; + }); + return true; end -- cgit v1.2.3