diff mod_mam/mod_mam.lua @ 2515:4cb549622862

mod_mam: Fix to expect archive id as first return value from archive:append
author Kim Alvefur <zash@zash.se>
date Mon, 20 Feb 2017 01:58:00 +0100
parents 66a61f48e376
children 248054199d0f
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Mon Feb 20 01:47:44 2017 +0100
+++ b/mod_mam/mod_mam.lua	Mon Feb 20 01:58:00 2017 +0100
@@ -286,8 +286,9 @@
 		log("debug", "Archiving stanza: %s", stanza:top_tag());
 
 		-- And stash it
-		local ok, id = archive:append(store_user, nil, stanza, time_now(), with);
+		local ok = archive:append(store_user, nil, stanza, time_now(), with);
 		if ok then
+			local id = ok;
 			if cleanup then cleanup[store_user] = true; end
 			module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id });
 		end