✏️ 修复 control 全局禁用

This commit is contained in:
fumiama 2021-11-27 00:40:48 +08:00
parent 35f7450ab2
commit ab34930beb

View File

@ -105,7 +105,13 @@ func (m *Control) IsEnabledIn(gid int64) bool {
m.RUnlock() m.RUnlock()
if err == nil && c.GroupID == 0 { if err == nil && c.GroupID == 0 {
logrus.Debugf("[control] plugin %s of all : %d", m.service, c.Disable) 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 return !m.options.DisableOnDefault
} }