diff options
author | Kim Alvefur <zash@zash.se> | 2016-04-12 19:35:55 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-04-12 19:35:55 +0200 |
commit | 92f1afc3f55f9c879f1a4df1b65db70659087f90 (patch) | |
tree | b27f8273dc93524710b2f58e100be3b7d86679f2 /plugins/muc | |
parent | c1c07f95ce0ae017932036e0dd87d6191fc15e3b (diff) | |
download | prosody-92f1afc3f55f9c879f1a4df1b65db70659087f90.tar.gz prosody-92f1afc3f55f9c879f1a4df1b65db70659087f90.zip |
MUC: Move history to room._history
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/history.lib.lua | 6 | ||||
-rw-r--r-- | plugins/muc/mod_muc.lua | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/plugins/muc/history.lib.lua b/plugins/muc/history.lib.lua index 6fdef96f..0fc0dfa3 100644 --- a/plugins/muc/history.lib.lua +++ b/plugins/muc/history.lib.lua @@ -79,7 +79,7 @@ end module:hook("muc-get-history", function(event) local room = event.room; - local history = room._data["history"]; -- send discussion history + local history = room._history; -- send discussion history if not history then return nil end local history_len = #history; @@ -140,8 +140,8 @@ module:hook("muc-add-history", function(event) local historic = event.stanza:get_child("body"); if historic then local room = event.room - local history = room._data["history"]; - if not history then history = {}; room._data["history"] = history; end + local history = room._history; + if not history then history = {}; room._history = history; end local stanza = st.clone(event.stanza); stanza.attr.to = ""; local ts = gettime(); diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 74909d9b..871b90b4 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -102,15 +102,12 @@ local function room_save(room, forced) local is_persistent = persistent.get(room); persistent_rooms:set(nil, room.jid, is_persistent); if is_persistent then - local room_history = room._data.history; - room._data.history = nil; local data = { jid = room.jid; _data = room._data; _affiliations = room._affiliations; }; room_configs:set(node, data); - room._data.history = room_history; elseif forced then room_configs:set(node, nil); if not next(room._occupants) then -- Room empty |