# HG changeset patch # User Matthew Wild # Date 1665491709 -3600 # Node ID 27e1d43542742f68d7d3050bfc2ddd8a24fd3c16 # Parent 6e3aa3995eab6532b00e06b37f8d8502caf0629a util.jid: Simplify boolean logic in conditionals diff -r 6e3aa3995eab -r 27e1d4354274 util/jid.lua --- a/util/jid.lua Tue Oct 11 13:33:19 2022 +0100 +++ b/util/jid.lua Tue Oct 11 13:35:09 2022 +0100 @@ -90,9 +90,9 @@ -- TODO compare to table of rules? local jid_node, jid_host, jid_resource = split(jid); local acl_node, acl_host, acl_resource = split(acl); - if ((acl_node ~= nil and acl_node == jid_node) or acl_node == nil) and - ((acl_host ~= nil and acl_host == jid_host) or acl_host == nil) and - ((acl_resource ~= nil and acl_resource == jid_resource) or acl_resource == nil) then + if (acl_node == nil or acl_node == jid_node) and + (acl_host == nil or acl_host == jid_host) and + (acl_resource == nil or acl_resource == jid_resource) then return true end return false