diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp index 08cb1bc9..707bf8b9 100644 --- a/lang/cpp/src/editinteractor.cpp +++ b/lang/cpp/src/editinteractor.cpp @@ -96,7 +96,13 @@ public: // advance to next state based on input: const unsigned int oldState = ei->state; - ei->state = ei->q->nextState(status, args, err); + + if (ei->q->needsNoResponse(status)) { + // keep state + } else { + ei->state = ei->q->nextState(status, args, err); + } + if (ei->debug) { std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n", oldState, status_to_string(status), args ? args : "", ei->state); diff --git a/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp b/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp index 8eec7460..49e98def 100644 --- a/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp +++ b/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp @@ -105,10 +105,6 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int static const Error NO_KEY_ERROR = Error::fromCode(GPG_ERR_NO_KEY); static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME); - if (q->needsNoResponse(status)) { - return q->state(); - } - switch (q->state()) { case START: if (status == GPGME_STATUS_GET_LINE && diff --git a/lang/cpp/src/gpgadduserideditinteractor.cpp b/lang/cpp/src/gpgadduserideditinteractor.cpp index c26f5593..1f27c84f 100644 --- a/lang/cpp/src/gpgadduserideditinteractor.cpp +++ b/lang/cpp/src/gpgadduserideditinteractor.cpp @@ -120,10 +120,6 @@ unsigned int GpgAddUserIDEditInteractor::nextState(unsigned int status, const ch static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgAddUserIDEditInteractor_Private; switch (state()) { diff --git a/lang/cpp/src/gpggencardkeyinteractor.cpp b/lang/cpp/src/gpggencardkeyinteractor.cpp index a28169ec..cd226c27 100644 --- a/lang/cpp/src/gpggencardkeyinteractor.cpp +++ b/lang/cpp/src/gpggencardkeyinteractor.cpp @@ -192,10 +192,6 @@ unsigned int GpgGenCardKeyInteractor::nextState(unsigned int status, const char static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgGenCardKeyInteractor_Private; switch (state()) { diff --git a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp index 86b3c3c4..fd584099 100644 --- a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp +++ b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp @@ -112,10 +112,6 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status, static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); - if (q->needsNoResponse(status)) { - return q->state(); - } - if (status == GPGME_STATUS_ERROR) { err = q->parseStatusError(args); return ERROR; diff --git a/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp b/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp index 2936d194..2409ef19 100644 --- a/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp +++ b/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp @@ -94,10 +94,6 @@ unsigned int GpgSetExpiryTimeEditInteractor::nextState(unsigned int status, cons static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgSetExpiryTimeEditInteractor_Private; switch (state()) { diff --git a/lang/cpp/src/gpgsetownertrusteditinteractor.cpp b/lang/cpp/src/gpgsetownertrusteditinteractor.cpp index f1e99ea9..e28951ba 100644 --- a/lang/cpp/src/gpgsetownertrusteditinteractor.cpp +++ b/lang/cpp/src/gpgsetownertrusteditinteractor.cpp @@ -98,10 +98,6 @@ unsigned int GpgSetOwnerTrustEditInteractor::nextState(unsigned int status, cons static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); //static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME ); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgSetOwnerTrustEditInteractor_Private; switch (state()) { diff --git a/lang/cpp/src/gpgsignkeyeditinteractor.cpp b/lang/cpp/src/gpgsignkeyeditinteractor.cpp index 1c8af148..164cfc03 100644 --- a/lang/cpp/src/gpgsignkeyeditinteractor.cpp +++ b/lang/cpp/src/gpgsignkeyeditinteractor.cpp @@ -304,9 +304,6 @@ unsigned int GpgSignKeyEditInteractor::nextState(unsigned int status, const char static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); //static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME ); static const TransitionMap table(makeTable()); - if (needsNoResponse(status)) { - return state(); - } using namespace GpgSignKeyEditInteractor_Private;