From ab34930beb89d23744bd7c71ebe0ba2cbba0d808 Mon Sep 17 00:00:00 2001 From: fumiama Date: Sat, 27 Nov 2021 00:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20=E4=BF=AE=E5=A4=8D=20co?= =?UTF-8?q?ntrol=20=E5=85=A8=E5=B1=80=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/rule.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/control/rule.go b/control/rule.go index 0edd6d1f..7b817553 100644 --- a/control/rule.go +++ b/control/rule.go @@ -105,7 +105,13 @@ func (m *Control) IsEnabledIn(gid int64) bool { m.RUnlock() if err == nil && c.GroupID == 0 { logrus.Debugf("[control] plugin %s of all : %d", m.service, c.Disable) - return c.Disable == 0 + if m.options.DisableOnDefault { + if c.Disable == 0 { + return true + } + } else if c.Disable != 0 { + return false + } } return !m.options.DisableOnDefault }