fix proxy flush and enabled
This commit is contained in:
parent
47ba651ce1
commit
00f2a0271c
@ -11,12 +11,14 @@ import org.telegram.messenger.LocaleController;
|
|||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import tw.nekomimi.nekogram.NekoConfig;
|
||||||
import tw.nekomimi.nekogram.parts.ProxyLoadsKt;
|
import tw.nekomimi.nekogram.parts.ProxyLoadsKt;
|
||||||
|
|
||||||
@Index("id")
|
@Index("id")
|
||||||
@ -47,7 +49,18 @@ public class SubInfo implements Mappable {
|
|||||||
HashMap<String, Exception> exceptions = new HashMap<>();
|
HashMap<String, Exception> exceptions = new HashMap<>();
|
||||||
|
|
||||||
try {
|
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) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user