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 | 9328daeaca197d5aa90f4c340be7aad6b3b805b9 (patch) | |
tree | 822560647b3d846da175bf8d7dabebb349684883 /plugins/muc/mod_muc.lua | |
parent | b53a3f65e084e6d148f7440e49f6a5a2b971bb93 (diff) | |
download | prosody-9328daeaca197d5aa90f4c340be7aad6b3b805b9.tar.gz prosody-9328daeaca197d5aa90f4c340be7aad6b3b805b9.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); |