diff plugins/mod_mam/mod_mam.lua @ 8539:41b5f070d7bb

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 24 Feb 2018 11:51:43 +0100
parents 3eb4cafb3b64
children 5040c8ce32dd
line wrap: on
line diff
--- a/plugins/mod_mam/mod_mam.lua	Sat Feb 24 11:50:08 2018 +0100
+++ b/plugins/mod_mam/mod_mam.lua	Sat Feb 24 11:51:43 2018 +0100
@@ -76,7 +76,7 @@
 			return true;
 		end
 	end
-	local prefs = prefs_to_stanza(get_prefs(user));
+	local prefs = prefs_to_stanza(get_prefs(user, true));
 	local reply = st.reply(stanza):add_child(prefs);
 	origin.send(reply);
 	return true;
@@ -92,6 +92,7 @@
 -- Serve form
 module:hook("iq-get/self/"..xmlns_mam..":query", function(event)
 	local origin, stanza = event.origin, event.stanza;
+	get_prefs(origin.username, true);
 	origin.send(st.reply(stanza):query(xmlns_mam):add_child(query_form:form()));
 	return true;
 end);
@@ -102,6 +103,7 @@
 	local query = stanza.tags[1];
 	local qid = query.attr.queryid;
 
+	get_prefs(origin.username, true);
 	schedule_cleanup(origin.username);
 
 	-- Search query parameters