Software /
code /
prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 8149:1dc6efcc420a
mod_mam: Attach stanza-id to original stanza (fixes #917)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 20 May 2017 14:58:56 +0200 |
parent | 8140:2bda04a7b4d4 |
child | 8172:66e32c34250b |
comparison
equal
deleted
inserted
replaced
8147:d44c6582059d | 8149:1dc6efcc420a |
---|---|
288 | 288 |
289 -- And stash it | 289 -- And stash it |
290 local ok = archive:append(store_user, nil, stanza, time_now(), with); | 290 local ok = archive:append(store_user, nil, stanza, time_now(), with); |
291 if ok then | 291 if ok then |
292 local id = ok; | 292 local id = ok; |
293 stanza:tag("stanza-id", { xmlns = xmlns_st_id, by = store_user.."@"..host, id = id }):up(); | 293 event.stanza:tag("stanza-id", { xmlns = xmlns_st_id, by = store_user.."@"..host, id = id }):up(); |
294 if cleanup then cleanup[store_user] = true; end | 294 if cleanup then cleanup[store_user] = true; end |
295 module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); | 295 module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); |
296 end | 296 end |
297 else | 297 else |
298 log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); | 298 log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); |