chore: return missing code after merge with mmvm (#2553)

This commit is contained in:
vkamn
2026-05-01 20:50:24 +08:00
committed by GitHub
parent fd5051262d
commit b05ee0a654
8 changed files with 48 additions and 42 deletions

View File

@@ -307,7 +307,8 @@ bool SubscriptionUiController::updateServiceFromGateway(const int serverIndex, c
if (oldServerConfig.isApiV2()) {
const ApiV2ServerConfig *oldApiV2 = oldServerConfig.as<ApiV2ServerConfig>();
if (oldApiV2) {
wasSubscriptionExpired = oldApiV2->apiConfig.isSubscriptionExpired();
wasSubscriptionExpired = oldApiV2->apiConfig.subscriptionExpiredByServer
|| oldApiV2->apiConfig.isSubscriptionExpired();
}
}
@@ -328,8 +329,9 @@ bool SubscriptionUiController::updateServiceFromGateway(const int serverIndex, c
} else {
if (errorCode == ErrorCode::ApiSubscriptionExpiredError) {
emit subscriptionExpiredOnServer();
} else {
emit errorOccurred(errorCode);
}
emit errorOccurred(errorCode);
return false;
}
}
@@ -352,14 +354,10 @@ bool SubscriptionUiController::updateServiceFromTelegram(const int serverIndex)
}
}
bool SubscriptionUiController::deactivateDevice(int serverIndex, const bool isRemoveEvent)
bool SubscriptionUiController::deactivateDevice(int serverIndex)
{
ErrorCode errorCode = m_subscriptionController->deactivateDevice(serverIndex, isRemoveEvent);
ErrorCode errorCode = m_subscriptionController->deactivateDevice(serverIndex);
if (errorCode != ErrorCode::NoError) {
if (errorCode == ErrorCode::ApiSubscriptionExpiredError && isRemoveEvent) {
return true;
}
emit errorOccurred(errorCode);
return false;
}
@@ -386,7 +384,11 @@ void SubscriptionUiController::validateConfig()
ErrorCode errorCode = m_subscriptionController->validateAndUpdateConfig(serverIndex, hasInstalledContainers);
if (errorCode != ErrorCode::NoError) {
emit errorOccurred(errorCode);
if (errorCode == ErrorCode::ApiSubscriptionExpiredError) {
emit subscriptionExpiredOnServer();
} else {
emit errorOccurred(errorCode);
}
emit configValidated(false);
return;
}
@@ -476,6 +478,9 @@ void SubscriptionUiController::getRenewalLink(int serverIndex)
emit errorOccurred(errorCode);
return;
}
if (url.isEmpty()) {
return;
}
emit renewalLinkReceived(url);
});
watcher->setFuture(m_subscriptionController->getRenewalLink(serverIndex));