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

@@ -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);
}