Mercurial > prosody-modules
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 2514:d47a7e6e9adc | 2515:4cb549622862 |
|---|---|
| 284 -- Check with the users preferences | 284 -- Check with the users preferences |
| 285 if shall_store(store_user, with) then | 285 if shall_store(store_user, with) then |
| 286 log("debug", "Archiving stanza: %s", stanza:top_tag()); | 286 log("debug", "Archiving stanza: %s", stanza:top_tag()); |
| 287 | 287 |
| 288 -- And stash it | 288 -- And stash it |
| 289 local ok, id = archive:append(store_user, nil, stanza, time_now(), with); | 289 local ok = archive:append(store_user, nil, stanza, time_now(), with); |
| 290 if ok then | 290 if ok then |
| 291 local id = ok; | |
| 291 if cleanup then cleanup[store_user] = true; end | 292 if cleanup then cleanup[store_user] = true; end |
| 292 module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); | 293 module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); |
| 293 end | 294 end |
| 294 else | 295 else |
| 295 log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); | 296 log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); |
