comparison 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
comparison
equal deleted inserted replaced
4058:cf9a1c7d558d 4059:072366857d79
209 return origin.send(reply); 209 return origin.send(reply);
210 end); 210 end);
211 211
212 module:hook("muc-broadcast-message", function (event) 212 module:hook("muc-broadcast-message", function (event)
213 local room, stanza = event.room, event.stanza; 213 local room, stanza = event.room, event.stanza;
214 local archive_id = stanza:get_child_text("stanza-id", "urn:xmpp:sid:0"); 214 local archive_id = stanza:get_child("stanza-id", "urn:xmpp:sid:0");
215 if archive_id then 215 if archive_id and archive_id.attr.id then
216 -- Remember the id of the last message so we can compare it 216 -- Remember the id of the last message so we can compare it
217 -- to the per-user marker (managed by mod_muc_markers) 217 -- to the per-user marker (managed by mod_muc_markers)
218 update_room_activity(room.jid, archive_id); 218 update_room_activity(room.jid, archive_id.attr.id);
219 -- Notify any users that need to be notified 219 -- Notify any users that need to be notified
220 notify_interested_users(room.jid); 220 notify_interested_users(room.jid);
221 end 221 end
222 end, -1); 222 end, -1);
223 223