summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java8
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java6
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
index a12b10c..0808f4f 100644
--- a/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
+++ b/src/main/java/com/aizistral/nochatreports/core/ServerSafetyLevel.java
@@ -37,6 +37,14 @@ public enum ServerSafetyLevel {
INSECURE,
/**
+ * Servers that don't require signatures but the user gave them anyway by whitelisting.
+ * The state is only displayed after the player toggles the whitelist for a server, because
+ * it is not possible to determine whether a server requires signatures if they are already given.
+ */
+
+ INSECURE_WHITELISTED,
+
+ /**
* For Realms specifically, as these are a whole new level of unsafe.
*/
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
index a77d81c..53b7149 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
@@ -86,7 +86,9 @@ public abstract class MixinChatScreen extends Screen {
if (ServerSafetyState.getCurrent() != ServerSafetyLevel.SECURE) {
ServerSafetyState.setAllowChatSigning(true);
- ServerSafetyState.updateCurrent(ServerSafetyLevel.INSECURE);
+ if(ServerSafetyState.getCurrent() != ServerSafetyLevel.INSECURE){
+ ServerSafetyState.updateCurrent(ServerSafetyLevel.INSECURE_WHITELISTED);
+ }
}
} else {
whitelist.remove(address);
@@ -183,7 +185,7 @@ public abstract class MixinChatScreen extends Screen {
return switch (level) {
case SECURE -> 21;
case UNINTRUSIVE -> 42;
- case INSECURE -> 0;
+ case INSECURE, INSECURE_WHITELISTED -> 0;
case REALMS -> 63;
case UNKNOWN -> 84;
case UNDEFINED -> 105;