mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-17 08:16:06 +03:00
* refactor: remove serverConfig struct * refactor: add warnings for api v1 configs * refactor: moved the server type definition to a separate namespace * refactor: simplified gateway stacks * fix: fixed server description * fix: fixed postAsync reply usage * fix: fixed validateConfig call * fix: fixed server name in notifications * fix: fixed initPrepareConfigHandler for lagacy configs
41 lines
759 B
C++
41 lines
759 B
C++
#ifndef SERVERCONFIGUTILS_H
|
|
#define SERVERCONFIGUTILS_H
|
|
|
|
#include <QJsonObject>
|
|
|
|
namespace serverConfigUtils
|
|
{
|
|
|
|
enum ConfigType {
|
|
AmneziaFreeV2 = 0,
|
|
AmneziaFreeV3,
|
|
AmneziaPremiumV1,
|
|
AmneziaPremiumV2,
|
|
SelfHosted,
|
|
ExternalPremium,
|
|
|
|
SelfHostedAdmin = 8,
|
|
SelfHostedUser,
|
|
Native,
|
|
Invalid
|
|
};
|
|
|
|
enum ConfigSource {
|
|
Telegram = 1,
|
|
AmneziaGateway
|
|
};
|
|
|
|
bool isServerFromApi(const QJsonObject &serverConfigObject);
|
|
|
|
ConfigSource getConfigSource(const QJsonObject &serverConfigObject);
|
|
|
|
ConfigType configTypeFromJson(const QJsonObject &serverConfigObject);
|
|
|
|
bool isLegacyApiSubscription(ConfigType configType);
|
|
|
|
bool isApiV2Subscription(ConfigType configType);
|
|
|
|
} // namespace serverConfigUtils
|
|
|
|
#endif // SERVERCONFIGUTILS_H
|