# HG changeset patch # User Kim Alvefur # Date 1487550408 -3600 # Node ID dbdaa8487ecd5326fbb0394c0840b27c661b6535 # Parent 8e2446cdf6fa51f1b94b6931141a702927a8d342 mod_mam: Fix to treat first return value from archive:append as assigned ID diff -r 8e2446cdf6fa -r dbdaa8487ecd plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Mon Feb 20 01:26:03 2017 +0100 +++ b/plugins/mod_mam/mod_mam.lua Mon Feb 20 01:26:48 2017 +0100 @@ -291,8 +291,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; stanza:tag("stanza-id", { xmlns = xmlns_st_id, by = store_user.."@"..host, id = id }):up(); if cleanup then cleanup[store_user] = true; end module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id });