Changeset

12189:82c8e855c850

mod_storage_xep0227: treat roster metadata pseudo-entry correctly The roster version is stored in a pseudo-item which has the key `false`. The if condition in the touched code attempts to guard against this, but it does not take into account that the jid prepping returns nil instead of false. By moving the jid prepping into the if, we can check for the metadata entry safely.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 15 Jan 2022 15:40:29 +0100
parents 12188:0fee75871f78
children 12190:3616128cd2e3
files plugins/mod_storage_xep0227.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_xep0227.lua	Sat Jan 15 15:39:13 2022 +0100
+++ b/plugins/mod_storage_xep0227.lua	Sat Jan 15 15:40:29 2022 +0100
@@ -250,8 +250,8 @@
 				local roster = st.stanza("query", {xmlns='jabber:iq:roster'});
 				usere:add_child(roster);
 				for contact_jid, item in pairs(data) do
-					contact_jid = jid_bare(jid_prep(contact_jid));
 					if contact_jid ~= false then
+						contact_jid = jid_bare(jid_prep(contact_jid));
 						if contact_jid ~= user_jid then -- Skip self-contacts
 							roster:tag("item", {
 								jid = contact_jid,