Various whisper changes / fixes (#93)

* Fix persisting whisper channel

* Fix whisper channel name/key
This commit is contained in:
Josh (Vicarious) authored and GitHub committed 2020-10-03 02:56:00 -07:00
1 parent 13ac18bb36
commit 227a85e567
3 files changed
+12 -5

No files matched your search

@@ -17,12 +17,12 @@ public interface WhisperChannel extends ChatChannel, ForwardingAudience.Single {
@Override
default @NonNull String name() {
return "Party";
return "Whisper";
}
@Override
default @NonNull String key() {
return "party";
return "whisper";
}
}
@@ -3,6 +3,7 @@ package net.draycia.carbon.storage;
import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.api.users.UserChannelSettings;
import net.draycia.carbon.common.channels.CarbonWhisperChannel;
import net.draycia.carbon.util.FunctionalityConstants;
import io.github.leonardosnt.bungeechannelapi.BungeeChannelApi;
import net.draycia.carbon.CarbonChatBukkit;
@@ -151,6 +152,13 @@ public class BukkitChatUser implements ChatUser, ForwardingAudience {
}
if (this.selectedChannelKey != null) {
if (this.selectedChannelKey.equals("whisper") && this.replyTarget != null) {
this.selectedChannel = new CarbonWhisperChannel(this,
this.carbonChat.userService().wrap(this.replyTarget));
return this.selectedChannel;
}
return this.carbonChat.channelRegistry().channelOrDefault(this.selectedChannelKey);
}
@@ -137,8 +137,6 @@ public class CarbonWhisperChannel implements WhisperChannel {
result.put(this.audience, receiverComponentEvent.component());
System.out.println(this.sender.equals(this.audience));
final ChatFormatEvent consoleFormatEvent = new ChatFormatEvent(this.sender, null, this,
this.consoleFormat(), message);
@@ -161,7 +159,8 @@ public class CarbonWhisperChannel implements WhisperChannel {
CarbonEvents.post(consoleEvent);
System.out.println(result.size());
this.sender.replyTarget(this.audience);
this.audience.replyTarget(this.sender);
return result;
}