diff options
Diffstat (limited to 'Swiften/AdHoc/OutgoingAdHocCommandSession.cpp')
-rw-r--r-- | Swiften/AdHoc/OutgoingAdHocCommandSession.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp index edacf94..da7f042 100644 --- a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp +++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp @@ -21,22 +21,24 @@ void OutgoingAdHocCommandSession::handleResponse(boost::shared_ptr<Command> payl } else { const std::vector<Command::Action> actions = payload->getAvailableActions(); actionStates_.clear(); - actionStates_[Command::Cancel] = EnabledAndPresent; - actionStates_[Command::Complete] = Present; - if (std::find(actions.begin(), actions.end(), Command::Complete) != actions.end()) { - actionStates_[Command::Complete] = EnabledAndPresent; - } - - if (getIsMultiStage()) { - actionStates_[Command::Next] = Present; - actionStates_[Command::Prev] = Present; - } + if (payload->getStatus() == Command::Executing ) { + actionStates_[Command::Cancel] = EnabledAndPresent; + actionStates_[Command::Complete] = Present; + if (std::find(actions.begin(), actions.end(), Command::Complete) != actions.end()) { + actionStates_[Command::Complete] = EnabledAndPresent; + } + + if (getIsMultiStage()) { + actionStates_[Command::Next] = Present; + actionStates_[Command::Prev] = Present; + } if (std::find(actions.begin(), actions.end(), Command::Next) != actions.end()) { - actionStates_[Command::Next] = EnabledAndPresent; - } + actionStates_[Command::Next] = EnabledAndPresent; + } if (std::find(actions.begin(), actions.end(), Command::Prev) != actions.end()) { - actionStates_[Command::Prev] = EnabledAndPresent; + actionStates_[Command::Prev] = EnabledAndPresent; + } } sessionID_ = payload->getSessionID(); |