forked from weiyang7965298/clients
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTGTelegramNetworking.m.diff
82 lines (79 loc) · 6.14 KB
/
TGTelegramNetworking.m.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/Telegraph/TGTelegramNetworking.m b/Telegraph/TGTelegramNetworking.m
index 7f526549..a17dd021 100644
--- a/Telegraph/TGTelegramNetworking.m
+++ b/Telegraph/TGTelegramNetworking.m
@@ -259,17 +259,27 @@ static TGTelegramNetworking *singleton = nil;
if (_isTestingEnvironment)
{
+#ifndef PATCH_BY_NEBULACHAT
[_context updateAddressSetForDatacenterWithId:1 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
[[MTDatacenterAddress alloc] initWithIp:@"149.154.175.10" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
]] forceUpdateSchemes:true];
[_context updateAddressSetForDatacenterWithId:2 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
[[MTDatacenterAddress alloc] initWithIp:@"149.154.167.40" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
]] forceUpdateSchemes:true];
+#else
+ [_context updateAddressSetForDatacenterWithId:1 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.100.25.99" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
+ ]] forceUpdateSchemes:true];
+ [_context updateAddressSetForDatacenterWithId:2 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"147.100.25.99" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
+ ]] forceUpdateSchemes:true];
+#endif
}
else
{
[_context performBatchUpdates:^
{
+#ifndef PATCH_BY_NEBULACHAT
[_context setSeedAddressSetForDatacenterWithId:1 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
[[MTDatacenterAddress alloc] initWithIp:@"149.154.175.50" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
[[MTDatacenterAddress alloc] initWithIp:@"2001:b28:f23d:f001::a" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
@@ -294,6 +304,27 @@ static TGTelegramNetworking *singleton = nil;
[[MTDatacenterAddress alloc] initWithIp:@"149.154.171.5" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
[[MTDatacenterAddress alloc] initWithIp:@"2001:b28:f23f:f005::a" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
]]];
+#else
+ [_context setSeedAddressSetForDatacenterWithId:1 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.103.102.219" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
+ ]]];
+
+ [_context setSeedAddressSetForDatacenterWithId:2 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.103.102.219" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
+ ]]];
+
+ [_context setSeedAddressSetForDatacenterWithId:3 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.103.102.219" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
+ ]]];
+
+ [_context setSeedAddressSetForDatacenterWithId:4 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.103.102.219" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
+ ]]];
+
+ [_context setSeedAddressSetForDatacenterWithId:5 seedAddressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.103.102.219" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil],
+ ]]];
+#endif
}];
}
@@ -301,12 +332,21 @@ static TGTelegramNetworking *singleton = nil;
if (_isTestingEnvironment)
{
+#ifndef PATCH_BY_NEBULACHAT
[_context updateAddressSetForDatacenterWithId:1 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
[[MTDatacenterAddress alloc] initWithIp:@"149.154.175.10" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
]] forceUpdateSchemes:true];
[_context updateAddressSetForDatacenterWithId:2 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
[[MTDatacenterAddress alloc] initWithIp:@"149.154.167.40" port:443 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
]] forceUpdateSchemes:true];
+#else
+ [_context updateAddressSetForDatacenterWithId:1 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.100.25.99" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
+ ]] forceUpdateSchemes:true];
+ [_context updateAddressSetForDatacenterWithId:2 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[
+ [[MTDatacenterAddress alloc] initWithIp:@"47.100.25.99" port:12345 preferForMedia:false restrictToTcp:false cdn:false preferForProxy:false secret:nil]
+ ]] forceUpdateSchemes:true];
+#endif
} else {
#if DEBUG
//[_context updateAddressSetForDatacenterWithId:1 addressSet:[[MTDatacenterAddressSet alloc] initWithAddressList:@[]] forceUpdateSchemes:true];