aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam/mamprefs.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-29 02:05:19 +0200
committerKim Alvefur <zash@zash.se>2017-10-29 02:05:19 +0200
commit89526be11ca68bf639927c4ed1bc808bb769f5f5 (patch)
tree0d8a66dad4d8c64d5cfab32c11132b2c0e1ca301 /plugins/mod_mam/mamprefs.lib.lua
parent62eaaff226249e924494f78434c422bd094264c1 (diff)
parent63e10c1c271e70eafc4257a54b07178488e33de1 (diff)
downloadprosody-89526be11ca68bf639927c4ed1bc808bb769f5f5.tar.gz
prosody-89526be11ca68bf639927c4ed1bc808bb769f5f5.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_mam/mamprefs.lib.lua')
-rw-r--r--plugins/mod_mam/mamprefs.lib.lua6
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