mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
fixed conf
This commit is contained in:
@@ -287,7 +287,10 @@ XrayClientConfig XrayClientConfig::fromJson(const QJsonObject &json)
|
||||
if (vnextObj.contains(protocols::xray::users)) {
|
||||
QJsonArray users = vnextObj[protocols::xray::users].toArray();
|
||||
if (!users.isEmpty()) {
|
||||
c.id = users[0].toObject().value(protocols::xray::id).toString();
|
||||
QJsonObject user = users[0].toObject();
|
||||
if (user.contains(protocols::xray::id)) {
|
||||
c.id = user[protocols::xray::id].toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,8 +338,10 @@ XrayProtocolConfig XrayProtocolConfig::fromJson(const QJsonObject &json)
|
||||
if (parsed.contains(protocols::xray::inbounds)) {
|
||||
QJsonArray inbounds = parsed.value(protocols::xray::inbounds).toArray();
|
||||
if (!inbounds.isEmpty()) {
|
||||
clientCfg.localPort = QString::number(
|
||||
inbounds[0].toObject().value(protocols::xray::port).toInt());
|
||||
QJsonObject inbound = inbounds[0].toObject();
|
||||
if (inbound.contains(protocols::xray::port)) {
|
||||
clientCfg.localPort = QString::number(inbound.value(protocols::xray::port).toInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
c.clientConfig = clientCfg;
|
||||
|
||||
@@ -344,8 +344,10 @@ void XrayConfigModel::applyDefaultsToServerConfig(amnezia::XrayServerConfig &con
|
||||
|
||||
amnezia::XrayProtocolConfig XrayConfigModel::getProtocolConfig()
|
||||
{
|
||||
if (!m_protocolConfig.serverConfig.hasEqualServerSettings(m_originalProtocolConfig.serverConfig))
|
||||
{
|
||||
const bool serverSettingsChanged =
|
||||
!m_protocolConfig.serverConfig.hasEqualServerSettings(m_originalProtocolConfig.serverConfig);
|
||||
|
||||
if (serverSettingsChanged) {
|
||||
m_protocolConfig.clearClientConfig();
|
||||
}
|
||||
return m_protocolConfig;
|
||||
|
||||
Reference in New Issue
Block a user