Software /
code /
prosody
Changeset
8353:aa6497031924
mod_mam: Load archiving preferes for offline users (fixes #1024)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 17 Oct 2017 12:42:20 +0200 |
parents | 8348:c3de5b454ec4 |
children | 8354:b41947a0fc0c |
files | plugins/mod_mam/mamprefs.lib.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_mam/mamprefs.lib.lua Mon Oct 23 15:23:03 2017 +0200 +++ b/plugins/mod_mam/mamprefs.lib.lua Tue Oct 17 12:42:20 2017 +0200 @@ -33,9 +33,11 @@ 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