aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJonas Schäfer <jonas@wielicki.name>2022-01-15 15:40:29 +0100
committerJonas Schäfer <jonas@wielicki.name>2022-01-15 15:40:29 +0100
commit91055b49bba7b0be8f2b25b96b0ae9ce2a4337ff (patch)
tree4497f4f91a8b50c89983f97a70a5adb686767f8a /plugins
parentbb100ed33ec5dfe46eccc3ac0a89e6d7f9952ac3 (diff)
downloadprosody-91055b49bba7b0be8f2b25b96b0ae9ce2a4337ff.tar.gz
prosody-91055b49bba7b0be8f2b25b96b0ae9ce2a4337ff.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_xep0227.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua
index 3cd783bc..a8f608b3 100644
--- a/plugins/mod_storage_xep0227.lua
+++ b/plugins/mod_storage_xep0227.lua
@@ -250,8 +250,8 @@ handlers.roster = {
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,