aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-03 13:44:30 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-03 13:44:30 +0100
commit8bb62f6b03572ec299d2998dfb0e0d52cf640f53 (patch)
treea7188eebd1711362a6e63a6b56ac05f0d771132c /plugins/muc/mod_muc.lua
parent33d53cff6c0f2427dbf55275e32b49188b27564d (diff)
downloadprosody-8bb62f6b03572ec299d2998dfb0e0d52cf640f53.tar.gz
prosody-8bb62f6b03572ec299d2998dfb0e0d52cf640f53.zip
mod_muc: Fire event when room is (and about to be) restored
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 9a7081bd..825dcdcb 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -188,6 +188,9 @@ local function restore_room(jid)
local data, err = room_configs:get(node);
if data then
module:log("debug", "Restoring room %s from storage", jid);
+ if module:fire_event("muc-room-pre-restore", { jid = jid, data = data }) == false then
+ return false;
+ end
local state, s_err = room_state:get(node);
if not state and s_err then
module:log("debug", "Could not restore state of room %s: %s", jid, s_err);
@@ -195,6 +198,7 @@ local function restore_room(jid)
local room = muclib.restore_room(data, state);
if track_room(room) then
room_state:set(node, nil);
+ module:fire_event("muc-room-restored", { jid = jid, room = room });
return room;
else
return false;