Diff

plugins/mod_mam/mamprefs.lib.lua @ 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
parent 7979:a1e88642411d
child 8538:3eb4cafb3b64
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