fix proxy flush and enabled

This commit is contained in:
luvletter2333 2022-06-25 20:05:53 +08:00
parent 47ba651ce1
commit 00f2a0271c
No known key found for this signature in database
GPG Key ID: A26A8880836E1978

View File

@ -11,12 +11,14 @@ import org.telegram.messenger.LocaleController;
import org.telegram.messenger.R;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import tw.nekomimi.nekogram.NekoConfig;
import tw.nekomimi.nekogram.parts.ProxyLoadsKt;
@Index("id")
@ -47,7 +49,18 @@ public class SubInfo implements Mappable {
HashMap<String, Exception> exceptions = new HashMap<>();
try {
return id == SubManager.publicProxySubID ? ProxyLoadsKt.loadProxiesPublic(urls, exceptions) : ProxyLoadsKt.loadProxies(urls, exceptions);
if (id == SubManager.publicProxySubID) {
if (!NekoConfig.enablePublicProxy.Bool())
return new ArrayList<>();
List<String> pubs = ProxyLoadsKt.loadProxiesPublic(urls, exceptions);
if (!NekoConfig.enablePublicProxy.Bool())
return new ArrayList<>();
else
return pubs;
} else {
return ProxyLoadsKt.loadProxies(urls, exceptions);
}
// return id == SubManager.publicProxySubID ? :
} catch (Exception ignored) {
}