Browse Source

[Minor] Reputation: deal with inbound/outbound both set

tags/1.7.0
Andrew Lewis 6 years ago
parent
commit
8be47cd463
1 changed files with 9 additions and 7 deletions
  1. 9
    7
      src/plugins/lua/reputation.lua

+ 9
- 7
src/plugins/lua/reputation.lua View File

@@ -763,13 +763,15 @@ local backends = {

local function is_rule_applicable(task, rule)
local ip = task:get_from_ip()
if rule.selector.config.outbound then
if not (task:get_user() or (ip and ip:is_local())) then
return false
end
elseif rule.selector.config.inbound then
if task:get_user() or (ip and ip:is_local()) then
return false
if not (rule.selector.config.outbound and rule.selector.config.inbound) then
if rule.selector.config.outbound then
if not (task:get_user() or (ip and ip:is_local())) then
return false
end
elseif rule.selector.config.inbound then
if task:get_user() or (ip and ip:is_local()) then
return false
end
end
end


Loading…
Cancel
Save