fix: server ip leaking in discord disconnect reason and *seen even when hidden: true
This commit is contained in:
@@ -1 +1 @@
|
||||
3663
|
||||
3664
|
||||
@@ -153,7 +153,9 @@ public class DiscordPlugin {
|
||||
public void disconnected (final DisconnectedEvent event) {
|
||||
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts >= 6) return;
|
||||
|
||||
final String reason = ComponentUtilities.stringifyDiscordAnsi(event.getReason());
|
||||
final String reason = ComponentUtilities.stringifyDiscordAnsi(event.getReason())
|
||||
.replace(bot.getServerString(true), bot.getServerString())
|
||||
.replace(bot.options.host, bot.getServerString());
|
||||
sendMessageInstantly(
|
||||
String.format(
|
||||
I18nUtilities.get("info.disconnected"),
|
||||
|
||||
@@ -100,7 +100,13 @@ public class PlayersDatabasePlugin implements Listener {
|
||||
if (!result.next()) return null; // doesn't exist
|
||||
|
||||
final long time = result.getTimestamp("time").getTime();
|
||||
final String server = result.getString("server");
|
||||
String server = result.getString("server");
|
||||
for (final Bot bot : Main.bots) {
|
||||
if (bot.options.hidden && bot.getServerString(true).equals(server)) {
|
||||
server = bot.getServerString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return LongObjectImmutablePair.of(time, server);
|
||||
} catch (final SQLException e) {
|
||||
|
||||
Reference in New Issue
Block a user