Skip to content

Commit

Permalink
Make OpenVPN 3.x paused status a bit nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
schwabe committed Aug 9, 2024
1 parent 017fa17 commit 6e9dcd4
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,22 @@ public void log(ClientAPI_LogInfo arg0) {
public void event(ClientAPI_Event event) {
String name = event.getName();
String info = event.getInfo();
if (name.equals("INFO")) {
if (info.startsWith("OPEN_URL:") || info.startsWith("CR_TEXT:")
|| info.startsWith("WEB_AUTH:")) {
mService.trigger_sso(info);
} else {
VpnStatus.logInfo(R.string.info_from_server, info);
switch (name) {
case "INFO" -> {
if (info.startsWith("OPEN_URL:") || info.startsWith("CR_TEXT:")
|| info.startsWith("WEB_AUTH:")) {
mService.trigger_sso(info);
} else {
VpnStatus.logInfo(R.string.info_from_server, info);
}
}
} else if (name.equals("COMPRESSION_ENABLED") || name.equals(("WARN"))) {
VpnStatus.logInfo(String.format(Locale.US, "%s: %s", name, info));
} else {
VpnStatus.updateStateString(name, info);
case "COMPRESSION_ENABLED", "WARN" ->
VpnStatus.logInfo(String.format(Locale.US, "%s: %s", name, info));
case "PAUSE" ->
VpnStatus.updateStateString(name, "VPN connection paused", R.string.state_userpause, ConnectionStatus.LEVEL_VPNPAUSED);
case "RESUME" ->
VpnStatus.updateStateString(name, "VPN connection resumed", R.string.state_reconnecting, ConnectionStatus.LEVEL_CONNECTING_NO_SERVER_REPLY_YET);
default -> VpnStatus.updateStateString(name, info);
}
/* if (event.name.equals("DYNAMIC_CHALLENGE")) {
ClientAPI_DynamicChallenge challenge = new ClientAPI_DynamicChallenge();
Expand Down

0 comments on commit 6e9dcd4

Please sign in to comment.