mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Make MySQL user service claim changes are remote
This commit is contained in:
1 parent
891036ba5f
commit
6c9b87b317
1 file changed
+9
-9
@@ -136,18 +136,18 @@ public class MySQLUserService implements UserService {
|
|||||||
ChatChannel channel = carbonChat.getChannelManager().getChannelOrDefault(users.getString("channel"));
|
ChatChannel channel = carbonChat.getChannelManager().getChannelOrDefault(users.getString("channel"));
|
||||||
|
|
||||||
if (channel != null) {
|
if (channel != null) {
|
||||||
user.setSelectedChannel(channel);
|
user.setSelectedChannel(channel, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String nickname = users.getString("nickname");
|
String nickname = users.getString("nickname");
|
||||||
|
|
||||||
if (nickname != null) {
|
if (nickname != null) {
|
||||||
user.setNickname(nickname);
|
user.setNickname(nickname, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
user.setMuted(users.<Boolean>get("muted"));
|
user.setMuted(users.<Boolean>get("muted"), true);
|
||||||
user.setShadowMuted(users.<Boolean>get("shadowmuted"));
|
user.setShadowMuted(users.<Boolean>get("shadowmuted"), true);
|
||||||
user.setSpyingWhispers(users.<Boolean>get("spyingwhispers"));
|
user.setSpyingWhispers(users.<Boolean>get("spyingwhispers"), true);
|
||||||
|
|
||||||
for (DbRow channelSetting : channelSettings) {
|
for (DbRow channelSetting : channelSettings) {
|
||||||
ChatChannel chatChannel = carbonChat.getChannelManager().getRegistry().get(channelSetting.getString("channel"));
|
ChatChannel chatChannel = carbonChat.getChannelManager().getRegistry().get(channelSetting.getString("channel"));
|
||||||
@@ -155,19 +155,19 @@ public class MySQLUserService implements UserService {
|
|||||||
if (chatChannel != null) {
|
if (chatChannel != null) {
|
||||||
UserChannelSettings settings = user.getChannelSettings(chatChannel);
|
UserChannelSettings settings = user.getChannelSettings(chatChannel);
|
||||||
|
|
||||||
settings.setSpying(channelSetting.<Boolean>get("spying"));
|
settings.setSpying(channelSetting.<Boolean>get("spying"), true);
|
||||||
settings.setIgnoring(channelSetting.<Boolean>get("ignored"));
|
settings.setIgnoring(channelSetting.<Boolean>get("ignored"), true);
|
||||||
|
|
||||||
String color = channelSetting.getString("color");
|
String color = channelSetting.getString("color");
|
||||||
|
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
settings.setColor(TextColor.fromHexString(color));
|
settings.setColor(TextColor.fromHexString(color), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DbRow ignoredUser : ignoredUsers) {
|
for (DbRow ignoredUser : ignoredUsers) {
|
||||||
user.setIgnoringUser(UUID.fromString(ignoredUser.getString("user")), true);
|
user.setIgnoringUser(UUID.fromString(ignoredUser.getString("user")), true, true);
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Reference in new issue
Block a user