aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-04-15 17:06:04 -0400
committerdaurnimator <quae@daurnimator.com>2014-04-15 17:06:04 -0400
commit0f4dd8a1b5de82bef12ea4b4c5696188fd740be6 (patch)
tree822560647b3d846da175bf8d7dabebb349684883 /plugins/muc/mod_muc.lua
parentcd72b2acc4eb00c11c30eab62e1cbf496996c36e (diff)
downloadprosody-0f4dd8a1b5de82bef12ea4b4c5696188fd740be6.tar.gz
prosody-0f4dd8a1b5de82bef12ea4b4c5696188fd740be6.zip
plugins/muc: Move persistent room configuration to own module
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 6f6094b4..865e07b9 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -26,6 +26,7 @@ end
local muclib = module:require "muc";
local muc_new_room = muclib.new_room;
+local persistent = module:require "muc/persistent";
local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
local st = require "util.stanza";
@@ -65,8 +66,9 @@ end
local function room_save(room, forced)
local node = jid_split(room.jid);
- persistent_rooms[room.jid] = room._data.persistent;
- if room._data.persistent then
+ local is_persistent = persistent.get(room);
+ persistent_rooms[room.jid] = is_persistent;
+ if is_persistent then
local history = room._data.history;
room._data.history = nil;
local data = {
@@ -138,7 +140,7 @@ end)
module:hook("muc-occupant-left",function(event)
local room = event.room
- if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room
+ if not next(room._occupants) and not persistent.get(room) then -- empty, non-persistent room
module:fire_event("muc-room-destroyed", { room = room });
end
end);