MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / onAcknowledge

Method onAcknowledge

src/windscribe-cli/backendcommander.cpp:447–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447void BackendCommander::onAcknowledge(IPC::CliCommands::Acknowledge *ackCmd)
448{
449 // This only occurs on CLI with GUI backend; it just changes the appropriate window/tab. Do not wait for this operation.
450 if (cliArgs_.cliCommand() == CLI_COMMAND_LOCATIONS || cliArgs_.cliCommand() == CLI_COMMAND_LOCATIONS_STATIC || cliArgs_.cliCommand() == CLI_COMMAND_LOCATIONS_FAV
451 || cliArgs_.cliCommand() == CLI_COMMAND_PORTS) {
452 emit(finished(0, ""));
453 return;
454 }
455
456 if (!cliArgs_.nonBlocking()) {
457 sendStateCommand();
458 return;
459 }
460
461 if (cliArgs_.cliCommand() == CLI_COMMAND_CONNECT || cliArgs_.cliCommand() == CLI_COMMAND_CONNECT_BEST
462 || cliArgs_.cliCommand() == CLI_COMMAND_CONNECT_LOCATION || cliArgs_.cliCommand() == CLI_COMMAND_CONNECT_STATIC) {
463 emit(finished(0, QObject::tr("Connection is in progress. Use 'windscribe-cli status' to check for connection status.")));
464 }
465 else if (cliArgs_.cliCommand() == CLI_COMMAND_DISCONNECT) {
466 emit(finished(0, QObject::tr("Disconnection is in progress. Use 'windscribe-cli status' to check for connection status.")));
467 }
468 else if (cliArgs_.cliCommand() == CLI_COMMAND_FIREWALL_ON) {
469 emit(finished(0, QObject::tr("Firewall is on.")));
470 }
471 else if (cliArgs_.cliCommand() == CLI_COMMAND_FIREWALL_OFF) {
472 emit(finished(0, QObject::tr("Firewall is off.")));
473 }
474 else if (cliArgs_.cliCommand() == CLI_COMMAND_SET_KEYLIMIT_BEHAVIOR) {
475 emit(finished(0, QObject::tr("Key limit behaviour is set.")));
476 }
477 else if (cliArgs_.cliCommand() == CLI_COMMAND_SEND_LOGS) {
478 emit(finished(0, QObject::tr("Logs sent.")));
479 }
480 else if (cliArgs_.cliCommand() == CLI_COMMAND_RELOAD_CONFIG) {
481 emit(finished(0, QObject::tr("Preferences reloaded.")));
482 }
483 else if (cliArgs_.cliCommand() == CLI_COMMAND_SET_IGNORE_SSL_ERRORS) {
484 if (ackCmd->code_ != 0) {
485 emit(finished(ackCmd->code_, ackCmd->message_));
486 } else if (cliArgs_.ignoreSslErrors()) {
487 emit(finished(0, QObject::tr("Ignoring SSL errors for this session.")));
488 } else {
489 emit(finished(0, QObject::tr("SSL errors will no longer be ignored.")));
490 }
491 }
492 else if (cliArgs_.cliCommand() == CLI_COMMAND_IP_ROTATE) {
493 if (ackCmd->code_ == 2) {
494 emit(finished(ackCmd->code_, tr("IP rotate already in progress.")));
495 } else if (ackCmd->code_ != 0) {
496 emit(finished(ackCmd->code_, tr("Could not rotate IP. Please check that you have Windscribe Pro or have this location in your plan, or try again later.")));
497 } else {
498 emit(finished(0, QObject::tr("IP rotated.")));
499 }
500 }
501 else if (cliArgs_.cliCommand() == CLI_COMMAND_IP_FAV) {
502 if (ackCmd->code_ != 0) {
503 emit(finished(ackCmd->code_, tr("Could not favourite IP. Please check that you have Windscribe Pro or have this location in your plan, or try again later.")));
504 } else {

Callers

nothing calls this directly

Calls 4

emitFunction · 0.85
cliCommandMethod · 0.80
nonBlockingMethod · 0.80
ignoreSslErrorsMethod · 0.80

Tested by

no test coverage detected