Changeset

9061:82dd435c942c

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.
author Kim Alvefur <zash@zash.se>
date Sun, 29 Jul 2018 18:34:38 +0200
parents 9060:69bc3144c2b7
children 9062:1b272b51ae0f
files plugins/mod_pep_plus.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep_plus.lua	Sun Jul 29 00:17:41 2018 +0200
+++ b/plugins/mod_pep_plus.lua	Sun Jul 29 18:34:38 2018 +0200
@@ -423,7 +423,7 @@
 		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