diff options
author | daurnimator <quae@daurnimator.com> | 2014-04-15 17:06:04 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-04-15 17:06:04 -0400 |
commit | 0f4dd8a1b5de82bef12ea4b4c5696188fd740be6 (patch) | |
tree | 822560647b3d846da175bf8d7dabebb349684883 /plugins/muc/mod_muc.lua | |
parent | cd72b2acc4eb00c11c30eab62e1cbf496996c36e (diff) | |
download | prosody-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.lua | 8 |
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); |