aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-17 12:42:20 +0200
committerKim Alvefur <zash@zash.se>2017-10-17 12:42:20 +0200
commit155e81d053abb8d12f2812d3c4d1fd92289d7237 (patch)
tree15cde5abd96276134f74c9cd56ed45b62924d674
parent0341e89cbfbc04a50a4f0ea104bc7aa57032c1b1 (diff)
downloadprosody-im-server-155e81d053abb8d12f2812d3c4d1fd92289d7237.zip
prosody-im-server-155e81d053abb8d12f2812d3c4d1fd92289d7237.tar
mod_mam: Load archiving preferes for offline users (fixes #1024)
-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