mirror of https://github.com/NekoX-Dev/NekoX.git
Fix proxy usage before login
This commit is contained in:
parent
1ecfe3a9b0
commit
a9a6b72a42
|
@ -49,7 +49,6 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import kotlin.Unit;
|
||||
import tw.nekomimi.nekogram.NekoConfig;
|
||||
import tw.nekomimi.nekogram.parts.ProxySwitcher;
|
||||
import tw.nekomimi.nekogram.utils.DnsFactory;
|
||||
|
@ -695,6 +694,17 @@ public class ConnectionsManager extends BaseController {
|
|||
accountInstance.getMessagesController().checkPromoInfo(true);
|
||||
}
|
||||
}
|
||||
if (SharedConfig.loginingAccount != -1) {
|
||||
if (enabled && !TextUtils.isEmpty(address)) {
|
||||
native_setProxySettings(SharedConfig.loginingAccount, address, port, username, password, secret);
|
||||
} else {
|
||||
native_setProxySettings(SharedConfig.loginingAccount, "", 1080, "", "", "");
|
||||
}
|
||||
AccountInstance accountInstance = AccountInstance.getInstance(SharedConfig.loginingAccount);
|
||||
if (accountInstance.getUserConfig().isClientActivated()) {
|
||||
accountInstance.getMessagesController().checkPromoInfo(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static native void native_switchBackend(int currentAccount);
|
||||
|
|
Loading…
Reference in New Issue