Fixup commands/supplemental changes.

This commit is contained in:
clienthax 2021-08-21 17:02:18 +01:00
parent 4de5282bf3
commit c17cb44eaa
2 changed files with 90 additions and 66 deletions

View file

@ -19,11 +19,24 @@ public class CmdCtc {
public String processEnableDisable(boolean enabled) {
try {
//noinspection JavaReflectionMemberAccess
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setLeakChannels", Boolean.class);
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setLeakChannels", boolean.class);
m.invoke(StoreStream.getUserSettings(), enabled);
} catch (Exception e) {
System.out.println("Failed to call StoreStream.getUserSettings().setLeakChannels");
System.out.println("Declared");
for (Method m : StoreStream.getUserSettings().getClass().getDeclaredMethods()) {
System.out.println(m.getName()+" "+ m.toString());
}
System.out.println();
System.out.println("Methods");
for (Method m : StoreStream.getUserSettings().getClass().getMethods()) {
System.out.println(m.getName()+" "+ m.toString());
}
e.printStackTrace();
return "Failed to call StoreStream.getUserSettings().setLeakChannels";
}
return "CTC: Successfully set channelleak state."; // TODO use notification
}
@ -37,7 +50,7 @@ public class CmdCtc {
try {
//noinspection JavaReflectionMemberAccess
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setShowTyping", Boolean.class);
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setShowTyping", boolean.class);
m.invoke(StoreStream.getUserSettings(), enabled);
} catch (Exception e) {
System.out.println("Failed to call StoreStream.getUserSettings().setShowTyping");
@ -56,7 +69,7 @@ public class CmdCtc {
try {
//noinspection JavaReflectionMemberAccess
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setNoDelete", Boolean.class);
final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setNoDelete", boolean.class);
m.invoke(StoreStream.getUserSettings(), enabled);
} catch (Exception e) {
System.out.println("Failed to call StoreStream.getUserSettings().setNoDelete");