Skip to content

Commit

Permalink
Merge pull request #106 from BlitzOffline/fix/default-channel-permiss…
Browse files Browse the repository at this point in the history
…ions

Messages sent in the default channel will be seen by everyone
  • Loading branch information
Kqliber authored Aug 8, 2022
2 parents e051c54 + 2f22c17 commit 4941d60
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public String toString() {

@Override
public Set<User> targets(final @NotNull User source) {
if (plugin.configManager().channels().defaultChannel().equals(this.name()))
return plugin.usersHolder().users().stream()
.filter(user -> ChannelUtils.isTargetWithinRadius(source, user, radius()))
.collect(Collectors.toUnmodifiableSet());

return plugin.usersHolder().users().stream().filter(user ->
!(user instanceof ChatUser) ||
((ChatUser) user).player().hasPermission(ChannelUtils.SEE_CHANNEL_PERMISSION + name()))
Expand Down

0 comments on commit 4941d60

Please sign in to comment.