# HG changeset patch # User Matthew Wild # Date 1630532487 -3600 # Node ID 524a9103fb45d672be3b0a8f8b0847691ef87640 # Parent 6e5572fc6840bea0ebb3277c0549de8f69048a5d mod_muc_cloud_notify: Fix comparison between string and number in reference extraction. Fixes #1681. diff -r 6e5572fc6840 -r 524a9103fb45 mod_muc_cloud_notify/mod_muc_cloud_notify.lua --- a/mod_muc_cloud_notify/mod_muc_cloud_notify.lua Thu Aug 26 16:52:13 2021 +0100 +++ b/mod_muc_cloud_notify/mod_muc_cloud_notify.lua Wed Sep 01 22:41:27 2021 +0100 @@ -463,8 +463,9 @@ local body = stanza:get_child_text('body'); for reference in stanza:childtags("reference", "urn:xmpp:reference:0") do - if reference.attr['type'] == 'mention' and reference.attr['begin'] and reference.attr['end'] then - local nick = extract_reference(body, reference.attr['begin'], reference.attr['end']); + local ref_begin, ref_end = tonumber(reference.attr['begin']), tonumber(reference.attr['end']); + if reference.attr['type'] == 'mention' and ref_begin and ref_end then + local nick = extract_reference(body, ref_begin, ref_end); local jid = room:get_registered_jid(nick); if room._occupants[room.jid..'/'..nick] then