mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Check proxy availability in ProxiesBox.
This commit is contained in:
@@ -268,6 +268,22 @@ bool ProxyData::ValidSecret(const QString &secret) {
|
||||
return QRegularExpression("^[a-fA-F0-9]{32}$").match(secret).hasMatch();
|
||||
}
|
||||
|
||||
QNetworkProxy ToNetworkProxy(const ProxyData &proxy) {
|
||||
Expects(proxy.type != ProxyData::Type::Mtproto);
|
||||
|
||||
if (proxy.type == ProxyData::Type::None) {
|
||||
return QNetworkProxy::NoProxy;
|
||||
}
|
||||
return QNetworkProxy(
|
||||
(proxy.type == ProxyData::Type::Socks5
|
||||
? QNetworkProxy::Socks5Proxy
|
||||
: QNetworkProxy::HttpProxy),
|
||||
proxy.host,
|
||||
proxy.port,
|
||||
proxy.user,
|
||||
proxy.password);
|
||||
}
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
void start() {
|
||||
|
@@ -442,6 +442,8 @@ struct ProxyData {
|
||||
|
||||
};
|
||||
|
||||
QNetworkProxy ToNetworkProxy(const ProxyData &proxy);
|
||||
|
||||
enum DBIScale {
|
||||
dbisAuto = 0,
|
||||
dbisOne = 1,
|
||||
|
Reference in New Issue
Block a user