aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep_plus.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-29 18:34:38 +0200
committerKim Alvefur <zash@zash.se>2018-07-29 18:34:38 +0200
commit9ebd0d448763c18de04a39a8aa52521620659eca (patch)
treeb378db90b99e1bbcfa4f04df0aefd18321e38cee /plugins/mod_pep_plus.lua
parent6eb0c63e0de166776d590e4d65cc85c376226000 (diff)
downloadprosody-9ebd0d448763c18de04a39a8aa52521620659eca.tar.gz
prosody-9ebd0d448763c18de04a39a8aa52521620659eca.zip
mod_pep_plus: Fix boolean logic precedence (thanks Link Mauve)
In case of 'from' subscription to a JID without node, eg a component, the condition becomes true and update_subscriptions() is called with contact_node = nil, which causes a traceback.
Diffstat (limited to 'plugins/mod_pep_plus.lua')
-rw-r--r--plugins/mod_pep_plus.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua
index cccabf6f..89c1f820 100644
--- a/plugins/mod_pep_plus.lua
+++ b/plugins/mod_pep_plus.lua
@@ -423,7 +423,7 @@ module:hook("iq-result/bare/disco", function(event)
for jid, item in pairs(origin.roster) do -- for all interested contacts
if jid then
local contact_node, contact_host = jid_split(jid);
- if contact_host == host and item.subscription == "both" or item.subscription == "from" then
+ if contact_host == host and (item.subscription == "both" or item.subscription == "from") then
update_subscriptions(user_bare, contact_node, notify);
end
end