feature: retrieving support info from gateway (#1483)

* feature: retrieving support info from gateway

* feature: added "external-premium" service-type

* chore: fixed external premium visability
This commit is contained in:
Nethius 2025-04-16 09:58:44 +07:00 committed by GitHub
parent 68db721089
commit 7fd71a8408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 67 additions and 21 deletions

View file

@ -310,7 +310,7 @@ bool ApiConfigsController::deactivateDevice()
auto serverConfigObject = m_serversModel->getServerConfig(serverIndex);
auto apiConfigObject = serverConfigObject.value(configKey::apiConfig).toObject();
if (apiUtils::getConfigType(serverConfigObject) != apiDefs::ConfigType::AmneziaPremiumV2) {
if (!apiUtils::isPremiumServer(serverConfigObject)) {
return true;
}
@ -345,7 +345,7 @@ bool ApiConfigsController::deactivateExternalDevice(const QString &uuid, const Q
auto serverConfigObject = m_serversModel->getServerConfig(serverIndex);
auto apiConfigObject = serverConfigObject.value(configKey::apiConfig).toObject();
if (apiUtils::getConfigType(serverConfigObject) != apiDefs::ConfigType::AmneziaPremiumV2) {
if (!apiUtils::isPremiumServer(serverConfigObject)) {
return true;
}

View file

@ -62,7 +62,7 @@ bool ApiSettingsController::getAccountInfo(bool reload)
QByteArray responseBody;
if (apiUtils::getConfigType(serverConfig) == apiDefs::ConfigType::AmneziaPremiumV2) {
if (apiUtils::isPremiumServer(serverConfig)) {
ErrorCode errorCode = gatewayController.post(QString("%1v1/account_info"), apiPayload, responseBody);
if (errorCode != ErrorCode::NoError) {
emit errorOccurred(errorCode);