Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

黑名单逻辑有误 #56

Closed
typoverflow opened this issue Oct 23, 2021 · 1 comment
Closed

黑名单逻辑有误 #56

typoverflow opened this issue Oct 23, 2021 · 1 comment

Comments

@typoverflow
Copy link

Utils.kt的isPermitted函数中,判断黑名单的逻辑有误。原代码为

  fun isPermitted(subject: Contact?): Boolean {
      return when (PluginConfig.mode) {
...
          "blacklist" -> {
              when {
                  subject == null -> true
                  subject is User && !PluginData.userSet.contains(subject.id) -> true
                  subject is Group && !PluginData.groupSet.contains(subject.id) -> true
                  else -> true
              }
          }
          else -> true
      }
  }

其中的else分支应当返回false

@Samarium150
Copy link
Owner

确实,when里面的else应该是false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants