Changeset

2819:9ffb059c9ba5

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 2818:88474dd1af48
children 2820:f3a09a559201
files mod_mam/mamprefs.lib.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam/mamprefs.lib.lua	Fri Nov 10 05:33:28 2017 +0100
+++ b/mod_mam/mamprefs.lib.lua	Tue Oct 17 12:42:20 2017 +0200
@@ -24,9 +24,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