diff 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
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Tue Mar 21 04:26:00 2017 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Tue Mar 21 04:48:37 2017 +0100
@@ -299,9 +299,10 @@
 
 	local history, i = {}, 1;
 
-	for _, item, when in data do
+	for id, item, when in data do
 		item.attr.to = to;
 		item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203
+		item:tag("stanza-id", { xmlns = xmlns_st_id, by = room_jid, id = id }):up();
 		if maxchars then
 			local chars = #tostring(item);
 			if maxchars - chars < 0 then