mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
Initial steps in fixing redis and nicknames.
This commit is contained in:
1 parent
4bd0df8272
commit
5c6d05eb33
5 files changed
+150
-74
No files matched your search
@@ -49,6 +49,7 @@ public class RedisManager {
|
|||||||
|
|
||||||
subscribeConnection.addListener((RedisListener)(channel, message) -> {
|
subscribeConnection.addListener((RedisListener)(channel, message) -> {
|
||||||
UUID uuid = UUID.fromString(message.split(":", 2)[0]);
|
UUID uuid = UUID.fromString(message.split(":", 2)[0]);
|
||||||
|
System.out.println("receiving message, uuid: " + uuid);
|
||||||
|
|
||||||
ChatUser user = carbonChat.getUserService().wrapIfLoaded(uuid);
|
ChatUser user = carbonChat.getUserService().wrapIfLoaded(uuid);
|
||||||
|
|
||||||
@@ -58,6 +59,8 @@ public class RedisManager {
|
|||||||
|
|
||||||
String value = message.split(":", 2)[1];
|
String value = message.split(":", 2)[1];
|
||||||
|
|
||||||
|
System.out.println("user not null, value: " + value);
|
||||||
|
|
||||||
switch (channel.toLowerCase()) {
|
switch (channel.toLowerCase()) {
|
||||||
case "nickname":
|
case "nickname":
|
||||||
handleNicknameChange(user, value);
|
handleNicknameChange(user, value);
|
||||||
@@ -107,46 +110,55 @@ public class RedisManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleChannelColorChange(ChatUser user, String value) {
|
private void handleChannelColorChange(ChatUser user, String value) {
|
||||||
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setColor(TextColor.fromHexString(value));
|
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setColor(TextColor.fromHexString(value), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSpyingChannelChange(ChatUser user, String value, boolean b) {
|
private void handleSpyingChannelChange(ChatUser user, String value, boolean b) {
|
||||||
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setSpying(b);
|
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setSpying(b, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleIgnoringChannelChange(ChatUser user, String value, boolean b) {
|
private void handleIgnoringChannelChange(ChatUser user, String value, boolean b) {
|
||||||
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setIgnoring(b);
|
user.getChannelSettings(carbonChat.getChannelManager().getRegistry().get(value)).setIgnoring(b, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleIgnoringUserChange(ChatUser user, String value, boolean b) {
|
private void handleIgnoringUserChange(ChatUser user, String value, boolean b) {
|
||||||
user.setIgnoringUser(UUID.fromString(value), b);
|
user.setIgnoringUser(UUID.fromString(value), b, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleReplyTargetChange(ChatUser user, String value) {
|
private void handleReplyTargetChange(ChatUser user, String value) {
|
||||||
user.setReplyTarget(UUID.fromString(value));
|
user.setReplyTarget(UUID.fromString(value), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleShadowMutedChange(ChatUser user, String value) {
|
private void handleShadowMutedChange(ChatUser user, String value) {
|
||||||
user.setShadowMuted(value.equalsIgnoreCase("true"));
|
user.setShadowMuted(value.equalsIgnoreCase("true"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMutedChange(ChatUser user, String value) {
|
private void handleMutedChange(ChatUser user, String value) {
|
||||||
user.setMuted(value.equalsIgnoreCase("true"));
|
user.setMuted(value.equalsIgnoreCase("true"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSpyingWhispersChange(ChatUser user, String value) {
|
private void handleSpyingWhispersChange(ChatUser user, String value) {
|
||||||
user.setSpyingWhispers(value.equalsIgnoreCase("true"));
|
user.setSpyingWhispers(value.equalsIgnoreCase("true"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSelectedChannelChange(ChatUser user, String value) {
|
private void handleSelectedChannelChange(ChatUser user, String value) {
|
||||||
user.setSelectedChannel(carbonChat.getChannelManager().getRegistry().get(value));
|
user.setSelectedChannel(carbonChat.getChannelManager().getRegistry().get(value), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleNicknameChange(ChatUser user, String value) {
|
private void handleNicknameChange(ChatUser user, String value) {
|
||||||
user.setNickname(value);
|
System.out.println("nickname set!");
|
||||||
|
user.setNickname(value, true);
|
||||||
|
|
||||||
|
if (user.isOnline()) {
|
||||||
|
String message = carbonChat.getConfig().getString("language.nickname-set");
|
||||||
|
|
||||||
|
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(user.asPlayer(),
|
||||||
|
message, "nickname", value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void publishChange(UUID uuid, String field, String value) {
|
public void publishChange(UUID uuid, String field, String value) {
|
||||||
|
System.out.println("publishing change " + field);
|
||||||
publishSync.publish(field, uuid.toString() + ":" + value);
|
publishSync.publish(field, uuid.toString() + ":" + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,32 +17,67 @@ public interface ChatUser extends Audience {
|
|||||||
boolean isOnline();
|
boolean isOnline();
|
||||||
|
|
||||||
String getNickname();
|
String getNickname();
|
||||||
void setNickname(String nickname);
|
void setNickname(String nickname, boolean fromRemote);
|
||||||
|
default void setNickname(String nickname) {
|
||||||
|
this.setNickname(nickname, false);
|
||||||
|
}
|
||||||
|
|
||||||
ChatChannel getSelectedChannel();
|
ChatChannel getSelectedChannel();
|
||||||
void setSelectedChannel(ChatChannel channel);
|
void setSelectedChannel(ChatChannel channel, boolean fromRemote);
|
||||||
|
default void setSelectedChannel(ChatChannel channel) {
|
||||||
|
this.setSelectedChannel(channel, false);
|
||||||
|
}
|
||||||
|
|
||||||
void clearSelectedChannel();
|
void clearSelectedChannel();
|
||||||
|
|
||||||
UserChannelSettings getChannelSettings(ChatChannel channel);
|
UserChannelSettings getChannelSettings(ChatChannel channel);
|
||||||
|
|
||||||
void setSpyingWhispers(boolean spyingWhispers);
|
|
||||||
boolean isSpyingWhispers();
|
boolean isSpyingWhispers();
|
||||||
|
void setSpyingWhispers(boolean spyingWhispers, boolean fromRemote);
|
||||||
|
default void setSpyingWhispers(boolean spyingWhispers) {
|
||||||
|
this.setSpyingWhispers(spyingWhispers, false);
|
||||||
|
}
|
||||||
|
|
||||||
void setMuted(boolean muted);
|
|
||||||
boolean isMuted();
|
boolean isMuted();
|
||||||
|
void setMuted(boolean muted, boolean fromRemote);
|
||||||
|
default void setMuted(boolean muted) {
|
||||||
|
this.setMuted(muted, false);
|
||||||
|
}
|
||||||
|
|
||||||
void setShadowMuted(boolean shadowMuted);
|
|
||||||
boolean isShadowMuted();
|
boolean isShadowMuted();
|
||||||
|
void setShadowMuted(boolean shadowMuted, boolean fromRemote);
|
||||||
|
default void setShadowMuted(boolean shadowMuted) {
|
||||||
|
this.setShadowMuted(shadowMuted, false);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable UUID getReplyTarget();
|
@Nullable UUID getReplyTarget();
|
||||||
void setReplyTarget(@Nullable UUID target);
|
void setReplyTarget(@Nullable UUID target, boolean fromRemote);
|
||||||
void setReplyTarget(@Nullable ChatUser user);
|
default void setReplyTarget(@Nullable UUID target) {
|
||||||
|
this.setReplyTarget(target, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void setReplyTarget(@Nullable ChatUser user, boolean fromRemote) {
|
||||||
|
this.setReplyTarget(user.getUUID(), fromRemote);
|
||||||
|
}
|
||||||
|
default void setReplyTarget(@Nullable ChatUser user) {
|
||||||
|
this.setReplyTarget(user.getUUID(), false);
|
||||||
|
}
|
||||||
|
|
||||||
boolean isIgnoringUser(UUID uuid);
|
boolean isIgnoringUser(UUID uuid);
|
||||||
boolean isIgnoringUser(ChatUser user);
|
void setIgnoringUser(UUID uuid, boolean ignoring, boolean fromRemote);
|
||||||
void setIgnoringUser(UUID uuid, boolean ignoring);
|
default void setIgnoringUser(UUID uuid, boolean ignoring) {
|
||||||
void setIgnoringUser(ChatUser user, boolean ignoring);
|
this.setIgnoringUser(uuid, ignoring, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
default boolean isIgnoringUser(ChatUser user) {
|
||||||
|
return this.isIgnoringUser(user.getUUID());
|
||||||
|
}
|
||||||
|
default void setIgnoringUser(ChatUser user, boolean ignoring, boolean fromRemote) {
|
||||||
|
this.setIgnoringUser(user.getUUID(), ignoring, fromRemote);
|
||||||
|
}
|
||||||
|
default void setIgnoringUser(ChatUser user, boolean ignoring) {
|
||||||
|
this.setIgnoringUser(user.getUUID(), ignoring, false);
|
||||||
|
}
|
||||||
|
|
||||||
void sendMessage(ChatUser sender, String message);
|
void sendMessage(ChatUser sender, String message);
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,21 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
public interface UserChannelSettings {
|
public interface UserChannelSettings {
|
||||||
|
|
||||||
boolean isSpying();
|
boolean isSpying();
|
||||||
void setSpying(boolean spying);
|
void setSpying(boolean spying, boolean fromRemote);
|
||||||
|
default void setSpying(boolean spying) {
|
||||||
|
this.setSpying(spying, false);
|
||||||
|
}
|
||||||
|
|
||||||
boolean isIgnored();
|
boolean isIgnored();
|
||||||
void setIgnoring(boolean ignored);
|
void setIgnoring(boolean ignored, boolean fromRemote);
|
||||||
|
default void setIgnoring(boolean ignored) {
|
||||||
|
this.setIgnoring(ignored, false);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable TextColor getColor();
|
@Nullable TextColor getColor();
|
||||||
void setColor(@Nullable TextColor color);
|
void setColor(@Nullable TextColor color, boolean fromRemote);
|
||||||
|
default void setColor(@Nullable TextColor color) {
|
||||||
|
this.setColor(color, false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -37,11 +37,11 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
private transient UUID replyTarget = null;
|
private transient UUID replyTarget = null;
|
||||||
|
|
||||||
public CarbonChatUser() {
|
public CarbonChatUser() {
|
||||||
this.carbonChat = (CarbonChat)Bukkit.getPluginManager().getPlugin("CarbonChat");
|
this.carbonChat = (CarbonChat) Bukkit.getPluginManager().getPlugin("CarbonChat");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CarbonChatUser(UUID uuid) {
|
public CarbonChatUser(UUID uuid) {
|
||||||
this.carbonChat = (CarbonChat)Bukkit.getPluginManager().getPlugin("CarbonChat");
|
this.carbonChat = (CarbonChat) Bukkit.getPluginManager().getPlugin("CarbonChat");
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,17 +75,26 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
return nickname;
|
return nickname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNickname(String nickname) {
|
@Override
|
||||||
this.nickname = nickname;
|
public void setNickname(String nickname, boolean fromRemote) {
|
||||||
|
Component component = carbonChat.getAdventureManager().processMessage(nickname);
|
||||||
|
String legacyNickname = CarbonChat.LEGACY.serialize(component);
|
||||||
|
|
||||||
|
System.out.println(legacyNickname);
|
||||||
|
|
||||||
|
this.nickname = legacyNickname;
|
||||||
|
|
||||||
if (isOnline()) {
|
if (isOnline()) {
|
||||||
Component component = carbonChat.getAdventureManager().processMessage(nickname);
|
if (nickname != null) {
|
||||||
String legacyNickname = CarbonChat.LEGACY.serialize(component);
|
this.asPlayer().setDisplayName(legacyNickname);
|
||||||
|
} else {
|
||||||
this.asPlayer().setDisplayName(legacyNickname);
|
this.asPlayer().setDisplayName(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.publishChangeToRedis("nickname", nickname);
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("nickname", legacyNickname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,7 +103,7 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSelectedChannel(ChatChannel chatChannel) {
|
public void setSelectedChannel(ChatChannel chatChannel, boolean fromRemote) {
|
||||||
String failureMessage = carbonChat.getConfig().getString("language.channel-switch-failure");
|
String failureMessage = carbonChat.getConfig().getString("language.channel-switch-failure");
|
||||||
ChannelSwitchEvent event = new ChannelSwitchEvent(chatChannel, this, failureMessage);
|
ChannelSwitchEvent event = new ChannelSwitchEvent(chatChannel, this, failureMessage);
|
||||||
|
|
||||||
@@ -108,7 +117,10 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.selectedChannel = chatChannel.getKey();
|
this.selectedChannel = chatChannel.getKey();
|
||||||
this.publishChangeToRedis("selected-channel", chatChannel.getKey());
|
|
||||||
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("selected-channel", chatChannel.getKey());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -122,35 +134,33 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isIgnoringUser(ChatUser user) {
|
public void setIgnoringUser(UUID uuid, boolean ignoring, boolean fromRemote) {
|
||||||
return ignoredUsers.contains(user.getUUID());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setIgnoringUser(UUID uuid, boolean ignoring) {
|
|
||||||
if (ignoring) {
|
if (ignoring) {
|
||||||
this.publishChangeToRedis("ignoring-user", uuid.toString());
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("ignoring-user", uuid.toString());
|
||||||
|
}
|
||||||
|
|
||||||
ignoredUsers.add(uuid);
|
ignoredUsers.add(uuid);
|
||||||
} else {
|
} else {
|
||||||
this.publishChangeToRedis("unignoring-user", uuid.toString());
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("unignoring-user", uuid.toString());
|
||||||
|
}
|
||||||
|
|
||||||
ignoredUsers.remove(uuid);
|
ignoredUsers.remove(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setIgnoringUser(ChatUser user, boolean ignoring) {
|
|
||||||
setIgnoringUser(user.getUUID(), ignoring);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<UUID> getIgnoredUsers() {
|
public List<UUID> getIgnoredUsers() {
|
||||||
return ignoredUsers;
|
return ignoredUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMuted(boolean muted) {
|
public void setMuted(boolean muted, boolean fromRemote) {
|
||||||
this.muted = muted;
|
this.muted = muted;
|
||||||
|
|
||||||
this.publishChangeToRedis("muted", muted ? "true" : "false");
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("muted", muted ? "true" : "false");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -159,10 +169,12 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setShadowMuted(boolean shadowMuted) {
|
public void setShadowMuted(boolean shadowMuted, boolean fromRemote) {
|
||||||
this.shadowMuted = shadowMuted;
|
this.shadowMuted = shadowMuted;
|
||||||
|
|
||||||
this.publishChangeToRedis("shadow-muted", shadowMuted ? "true" : "false");
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("shadow-muted", shadowMuted ? "true" : "false");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -177,15 +189,12 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setReplyTarget(UUID target) {
|
public void setReplyTarget(UUID target, boolean fromRemote) {
|
||||||
this.replyTarget = target;
|
this.replyTarget = target;
|
||||||
|
|
||||||
this.publishChangeToRedis("reply-target", target.toString());
|
if (!fromRemote) {
|
||||||
}
|
this.publishChangeToRedis("reply-target", target.toString());
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public void setReplyTarget(ChatUser user) {
|
|
||||||
setReplyTarget(user.getUUID());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -200,10 +209,12 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSpyingWhispers(boolean spyingWhispers) {
|
public void setSpyingWhispers(boolean spyingWhispers, boolean fromRemote) {
|
||||||
this.spyingWhispers = spyingWhispers;
|
this.spyingWhispers = spyingWhispers;
|
||||||
|
|
||||||
this.publishChangeToRedis("spying-whispers", spyingWhispers ? "true" : "false");
|
if (!fromRemote) {
|
||||||
|
this.publishChangeToRedis("spying-whispers", spyingWhispers ? "true" : "false");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -233,12 +244,12 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
targetName = this.asPlayer().getDisplayName();
|
targetName = this.asPlayer().getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
Component toPlayerComponent = carbonChat.getAdventureManager().processMessage(toPlayerFormat, "br", "\n",
|
Component toPlayerComponent = carbonChat.getAdventureManager().processMessage(toPlayerFormat, "br", "\n",
|
||||||
"message", message,
|
"message", message,
|
||||||
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
||||||
"target", targetName, "sender", senderName);
|
"target", targetName, "sender", senderName);
|
||||||
|
|
||||||
Component fromPlayerComponent = carbonChat.getAdventureManager().processMessage(fromPlayerFormat, "br", "\n",
|
Component fromPlayerComponent = carbonChat.getAdventureManager().processMessage(fromPlayerFormat, "br", "\n",
|
||||||
"message", message,
|
"message", message,
|
||||||
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
||||||
"target", targetName, "sender", senderName);
|
"target", targetName, "sender", senderName);
|
||||||
@@ -290,10 +301,13 @@ public class CarbonChatUser implements ChatUser, ForwardingAudience {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* package */ void publishChangeToRedis(String key, String value) {
|
/* package */ void publishChangeToRedis(String key, String value) {
|
||||||
|
System.out.println("checking if null");
|
||||||
if (carbonChat.getRedisManager() == null) {
|
if (carbonChat.getRedisManager() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("not null");
|
||||||
|
|
||||||
carbonChat.getRedisManager().publishChange(uuid, key, value);
|
carbonChat.getRedisManager().publishChange(uuid, key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+18
-12
@@ -36,13 +36,15 @@ public class SimpleUserChannelSettings implements UserChannelSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSpying(boolean spying) {
|
public void setSpying(boolean spying, boolean fromRemote) {
|
||||||
this.spying = spying;
|
this.spying = spying;
|
||||||
|
|
||||||
if (spying) {
|
if (fromRemote) {
|
||||||
getUser().publishChangeToRedis("spying-channel", channel);
|
if (spying) {
|
||||||
} else {
|
getUser().publishChangeToRedis("spying-channel", channel);
|
||||||
getUser().publishChangeToRedis("unspying-channel", channel);
|
} else {
|
||||||
|
getUser().publishChangeToRedis("unspying-channel", channel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,13 +54,15 @@ public class SimpleUserChannelSettings implements UserChannelSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIgnoring(boolean ignored) {
|
public void setIgnoring(boolean ignored, boolean fromRemote) {
|
||||||
this.ignored = ignored;
|
this.ignored = ignored;
|
||||||
|
|
||||||
if (spying) {
|
if (fromRemote) {
|
||||||
getUser().publishChangeToRedis("ignoring-channel", channel);
|
if (spying) {
|
||||||
} else {
|
getUser().publishChangeToRedis("ignoring-channel", channel);
|
||||||
getUser().publishChangeToRedis("unignoring-channel", channel);
|
} else {
|
||||||
|
getUser().publishChangeToRedis("unignoring-channel", channel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,14 +76,16 @@ public class SimpleUserChannelSettings implements UserChannelSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setColor(@Nullable TextColor color) {
|
public void setColor(@Nullable TextColor color, boolean fromRemote) {
|
||||||
if (color == null) {
|
if (color == null) {
|
||||||
this.color = null;
|
this.color = null;
|
||||||
} else {
|
} else {
|
||||||
this.color = color.asHexString();
|
this.color = color.asHexString();
|
||||||
}
|
}
|
||||||
|
|
||||||
getUser().publishChangeToRedis("channel-color", this.color);
|
if (fromRemote) {
|
||||||
|
getUser().publishChangeToRedis("channel-color", this.color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user