diff options
author | daurnimator <quae@daurnimator.com> | 2014-09-05 11:28:28 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-09-05 11:28:28 -0400 |
commit | aa0dea0c38d2911bf9a531b78f9b7b3b54bf0865 (patch) | |
tree | a36e3ea532596536b5accca93922634b27037a89 /plugins | |
parent | 24eb372e33f37c917b008d90bf92a6ea8d020e34 (diff) | |
download | prosody-aa0dea0c38d2911bf9a531b78f9b7b3b54bf0865.tar.gz prosody-aa0dea0c38d2911bf9a531b78f9b7b3b54bf0865.zip |
plugins/muc/muc.lib: Add muc-set-affiliation event
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/muc.lib.lua | 11 |
1 files changed, 11 insertions, 0 deletions
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 |