From 903eceebdafcdfe567a970f07bf7e11c4d6d87b2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 29 Oct 2020 19:47:28 +0100 Subject: [PATCH] Simplify checkIgnored code from previous commit --- src/ircdb.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ircdb.py b/src/ircdb.py index 2e01107e5..4c866a8b6 100644 --- a/src/ircdb.py +++ b/src/ircdb.py @@ -1180,15 +1180,14 @@ def checkIgnored(hostmask, recipient='', users=users, channels=channels): return True else: try: - is_trusted = user._checkCapability('trusted') + if user._checkCapability('trusted'): + # Trusted users (including owners) shouldn't ever be ignored. + return False except KeyError: # neither explicitly trusted or -trusted -> consider them not # trusted - is_trusted = False - if is_trusted: - # Trusted users (including owners) shouldn't ever be ignored. - return False - elif user.ignore: + pass + if user.ignore: log.debug('Ignoring %s due to their IrcUser ignore flag.', hostmask) return True if ignores.checkIgnored(hostmask):