properly unify offline and vanish messages

This commit is contained in:
Draycia committed 2021-10-25 19:31:49 -07:00
1 parent 3b765a758a
commit 305803199b
3 files changed
+12 -18

No files matched your search

@@ -43,12 +43,10 @@ public class ContinueCommand {
.player(whisperTarget).join();
final @MonotonicNonNull CarbonPlayer recipient = result.player();
if (recipient == null || !recipient.online()) {
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
return;
}
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.continue")) {
if (!recipient.online()
|| (!sender.awareOf(recipient)
&& !sender.hasPermission("carbon.seevanish.whisper"))
) {
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
@@ -45,12 +45,10 @@ public class ReplyCommand {
final ComponentPlayerResult<CarbonPlayer> result = carbonChat.server().player(replyTarget).join();
final @MonotonicNonNull CarbonPlayer recipient = result.player();
if (recipient == null || !recipient.online()) {
messageService.replyTargetOffline(sender, CarbonPlayer.renderName(sender));
return;
}
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.reply")) {
if (!recipient.online()
|| (!sender.awareOf(recipient)
&& !sender.hasPermission("carbon.seevanish.whisper"))
) {
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
@@ -35,12 +35,10 @@ public class WhisperCommand {
return;
}
if (!recipient.online()) {
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
return;
}
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.whisper")) {
if (!recipient.online()
|| (!sender.awareOf(recipient)
&& !sender.hasPermission("carbon.seevanish.whisper"))
) {
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);