diff mod_muc_rai/mod_muc_rai.lua @ 4059:072366857d79

mod_muc_rai: Fix to correctly extract the archive id
author Matthew Wild <mwild1@gmail.com>
date Thu, 02 Jul 2020 12:18:35 +0100
parents cf9a1c7d558d
children b44620cacb11
line wrap: on
line diff
--- a/mod_muc_rai/mod_muc_rai.lua	Thu Jul 02 12:17:53 2020 +0100
+++ b/mod_muc_rai/mod_muc_rai.lua	Thu Jul 02 12:18:35 2020 +0100
@@ -211,11 +211,11 @@
 
 module:hook("muc-broadcast-message", function (event)
 	local room, stanza = event.room, event.stanza;
-	local archive_id = stanza:get_child_text("stanza-id", "urn:xmpp:sid:0");
-	if archive_id then
+	local archive_id = stanza:get_child("stanza-id", "urn:xmpp:sid:0");
+	if archive_id and archive_id.attr.id then
 		-- Remember the id of the last message so we can compare it
 		-- to the per-user marker (managed by mod_muc_markers)
-		update_room_activity(room.jid, archive_id);
+		update_room_activity(room.jid, archive_id.attr.id);
 		-- Notify any users that need to be notified
 		notify_interested_users(room.jid);
 	end