comparison mod_mam_muc/mod_mam_muc.lua @ 2628:fbb26a56a667

mod_mam_muc: Include stanza-id in history replay
author Kim Alvefur <zash@zash.se>
date Tue, 21 Mar 2017 04:48:37 +0100
parents 3f166242b460
children 02a7f9fe44fa
comparison
equal deleted inserted replaced
2627:3f166242b460 2628:fbb26a56a667
297 return 297 return
298 end 298 end
299 299
300 local history, i = {}, 1; 300 local history, i = {}, 1;
301 301
302 for _, item, when in data do 302 for id, item, when in data do
303 item.attr.to = to; 303 item.attr.to = to;
304 item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203 304 item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203
305 item:tag("stanza-id", { xmlns = xmlns_st_id, by = room_jid, id = id }):up();
305 if maxchars then 306 if maxchars then
306 local chars = #tostring(item); 307 local chars = #tostring(item);
307 if maxchars - chars < 0 then 308 if maxchars - chars < 0 then
308 break 309 break
309 end 310 end