diff options
author | Kim Alvefur <zash@zash.se> | 2017-10-17 12:42:20 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-10-17 12:42:20 +0200 |
commit | 5841c8c0645e1ce573b00e68d5b44c8f7edcf93e (patch) | |
tree | e7952cfb545a277af61023f57d21573f30989d19 /plugins/mod_mam | |
parent | 26f7e8de2c42283231a0ffd455f91f42273ccf30 (diff) | |
download | prosody-5841c8c0645e1ce573b00e68d5b44c8f7edcf93e.tar.gz prosody-5841c8c0645e1ce573b00e68d5b44c8f7edcf93e.zip |
mod_mam: Load archiving preferes for offline users (fixes #1024)
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r-- | plugins/mod_mam/mamprefs.lib.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_mam/mamprefs.lib.lua b/plugins/mod_mam/mamprefs.lib.lua index 72c08886..1e05b9d1 100644 --- a/plugins/mod_mam/mamprefs.lib.lua +++ b/plugins/mod_mam/mamprefs.lib.lua @@ -33,9 +33,11 @@ local prefs = module:open_store(archive_store .. "_prefs"); local function get_prefs(user) local user_sessions = sessions[user]; local user_prefs = user_sessions and user_sessions.archive_prefs - if not user_prefs and user_sessions then + if not user_prefs then user_prefs = prefs:get(user); - user_sessions.archive_prefs = user_prefs; + if user_sessions then + user_sessions.archive_prefs = user_prefs; + end end return user_prefs or { [false] = global_default_policy }; end |