Skip to content

Commit d6334b9

Browse files
author
Isaac
committed
Merge branch 'master' into post-suggestion
2 parents 603d575 + e8dc1e4 commit d6334b9

File tree

19 files changed

+390
-286
lines changed

19 files changed

+390
-286
lines changed

.vscode/launch.json

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,40 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"type": "sweetpad-lldb",
9-
"request": "attach",
10-
"name": "Attach to running app (SweetPad)",
11-
"preLaunchTask": "sweetpad: launch",
12-
"codelldbAttributes": {
13-
"initCommands": [
14-
"command source ~/.lldbinit-Xcode"
15-
]
16-
}
8+
"type": "swift",
9+
"request": "launch",
10+
"args": [],
11+
"cwd": "${workspaceFolder:telegram-ios}",
12+
"name": "Debug Telegram",
13+
"program": "${workspaceFolder:telegram-ios}/.build/debug/Telegram",
14+
"preLaunchTask": "swift: Build Debug Telegram"
15+
},
16+
{
17+
"type": "swift",
18+
"request": "launch",
19+
"args": [],
20+
"cwd": "${workspaceFolder:telegram-ios}",
21+
"name": "Release Telegram",
22+
"program": "${workspaceFolder:telegram-ios}/.build/release/Telegram",
23+
"preLaunchTask": "swift: Build Release Telegram"
24+
},
25+
{
26+
"type": "swift",
27+
"request": "launch",
28+
"args": [],
29+
"cwd": "${workspaceFolder:telegram-ios}",
30+
"name": "Debug telegram-ios",
31+
"program": "${workspaceFolder:telegram-ios}/.build/debug/telegram-ios",
32+
"preLaunchTask": "swift: Build Debug telegram-ios"
33+
},
34+
{
35+
"type": "swift",
36+
"request": "launch",
37+
"args": [],
38+
"cwd": "${workspaceFolder:telegram-ios}",
39+
"name": "Release telegram-ios",
40+
"program": "${workspaceFolder:telegram-ios}/.build/release/telegram-ios",
41+
"preLaunchTask": "swift: Build Release telegram-ios"
1742
}
1843
]
1944
}

.vscode/settings.json

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,14 @@
22
"sweetpad.build.xcodeWorkspacePath": "Telegram/Telegram.xcodeproj/project.xcworkspace",
33
"lldb.library": "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB",
44
"lldb.launch.expressions": "native",
5-
"files.associations": {
6-
"__bit_reference": "cpp",
7-
"__hash_table": "cpp",
8-
"__locale": "cpp",
9-
"__node_handle": "cpp",
10-
"__split_buffer": "cpp",
11-
"__threading_support": "cpp",
12-
"__tree": "cpp",
13-
"__verbose_abort": "cpp",
14-
"any": "cpp",
15-
"array": "cpp",
16-
"bitset": "cpp",
17-
"cctype": "cpp",
18-
"cfenv": "cpp",
19-
"charconv": "cpp",
20-
"cinttypes": "cpp",
21-
"clocale": "cpp",
22-
"cmath": "cpp",
23-
"codecvt": "cpp",
24-
"complex": "cpp",
25-
"condition_variable": "cpp",
26-
"csignal": "cpp",
27-
"cstdarg": "cpp",
28-
"cstddef": "cpp",
29-
"cstdint": "cpp",
30-
"cstdio": "cpp",
31-
"cstdlib": "cpp",
32-
"cstring": "cpp",
33-
"ctime": "cpp",
34-
"cwchar": "cpp",
35-
"cwctype": "cpp",
36-
"deque": "cpp",
37-
"execution": "cpp",
38-
"memory": "cpp",
39-
"forward_list": "cpp",
40-
"fstream": "cpp",
41-
"future": "cpp",
42-
"initializer_list": "cpp",
43-
"iomanip": "cpp",
44-
"ios": "cpp",
45-
"iosfwd": "cpp",
46-
"iostream": "cpp",
47-
"istream": "cpp",
48-
"limits": "cpp",
49-
"list": "cpp",
50-
"locale": "cpp",
51-
"map": "cpp",
52-
"mutex": "cpp",
53-
"new": "cpp",
54-
"optional": "cpp",
55-
"ostream": "cpp",
56-
"print": "cpp",
57-
"queue": "cpp",
58-
"ratio": "cpp",
59-
"regex": "cpp",
60-
"scoped_allocator": "cpp",
61-
"set": "cpp",
62-
"span": "cpp",
63-
"sstream": "cpp",
64-
"stack": "cpp",
65-
"stdexcept": "cpp",
66-
"streambuf": "cpp",
67-
"string": "cpp",
68-
"string_view": "cpp",
69-
"tuple": "cpp",
70-
"typeindex": "cpp",
71-
"typeinfo": "cpp",
72-
"unordered_map": "cpp",
73-
"unordered_set": "cpp",
74-
"valarray": "cpp",
75-
"variant": "cpp",
76-
"vector": "cpp",
77-
"algorithm": "cpp"
5+
"search.followSymlinks": false,
6+
"files.exclude": {
7+
".git/**": true
8+
},
9+
"files.watcherExclude": {
10+
".git/**": true
11+
},
12+
"search.exclude": {
13+
".git/**": true
7814
}
79-
}
15+
}

.vscode/tasks.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
{
22
"version": "2.0.0",
33
"tasks": [
4-
{
5-
"type": "sweetpad",
6-
"action": "launch",
7-
"problemMatcher": [
8-
"$sweetpad-watch", // ! Required for debugging
9-
"$sweetpad-xcodebuild-default",
10-
"$sweetpad-xcbeautify-errors",
11-
"$sweetpad-xcbeautify-warnings"
12-
],
13-
"label": "sweetpad: launch",
14-
"detail": "Build and Launch the app",
15-
"isBackground": true // ! Required for debugging
16-
}
174
]
185
}
196

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,11 @@ public enum SendInviteLinkScreenSubject {
995995
case groupCall(link: String)
996996
}
997997

998+
public enum StarsWithdrawalScreenSubject {
999+
case withdraw
1000+
case enterAmount(current: StarsAmount)
1001+
}
1002+
9981003
public protocol SharedAccountContext: AnyObject {
9991004
var sharedContainerPath: String { get }
10001005
var basePath: String { get }
@@ -1179,7 +1184,7 @@ public protocol SharedAccountContext: AnyObject {
11791184
func makeStarsStatisticsScreen(context: AccountContext, peerId: EnginePeer.Id, revenueContext: StarsRevenueStatsContext) -> ViewController
11801185
func makeStarsAmountScreen(context: AccountContext, initialValue: Int64?, completion: @escaping (Int64) -> Void) -> ViewController
11811186
func makeStarsWithdrawalScreen(context: AccountContext, stats: StarsRevenueStats, completion: @escaping (Int64) -> Void) -> ViewController
1182-
func makeStarsWithdrawalScreen(context: AccountContext, completion: @escaping (Int64) -> Void) -> ViewController
1187+
func makeStarsWithdrawalScreen(context: AccountContext, subject: StarsWithdrawalScreenSubject, completion: @escaping (Int64) -> Void) -> ViewController
11831188
func makeStarGiftResellScreen(context: AccountContext, update: Bool, completion: @escaping (Int64) -> Void) -> ViewController
11841189
func makeStarsGiftScreen(context: AccountContext, message: EngineMessage) -> ViewController
11851190
func makeStarsGiveawayBoostScreen(context: AccountContext, peerId: EnginePeer.Id, boost: ChannelBoostersContext.State.Boost) -> ViewController

submodules/MtProtoKit/Sources/GCDAsyncSocket.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4294,7 +4294,7 @@ - (void)doReadData
42944294
return;
42954295
}
42964296

4297-
BOOL hasBytesAvailable;
4297+
BOOL hasBytesAvailable = false;
42984298
unsigned long estimatedBytesAvailable;
42994299

43004300
if ([self usingCFStreamForTLS])

submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ private final class ChannelPermissionsControllerArguments {
3838
let updateSlowmode: (Int32) -> Void
3939
let updateUnrestrictBoosters: (Int32) -> Void
4040
let updateStarsAmount: (StarsAmount?, Bool) -> Void
41+
let openSetCustomStarsAmount: () -> Void
4142
let toggleIsOptionExpanded: (TelegramChatBannedRightsFlags) -> Void
4243

43-
init(context: AccountContext, updatePermission: @escaping (TelegramChatBannedRightsFlags, Bool) -> Void, setPeerIdWithRevealedOptions: @escaping (EnginePeer.Id?, EnginePeer.Id?) -> Void, addPeer: @escaping () -> Void, removePeer: @escaping (EnginePeer.Id) -> Void, openPeer: @escaping (ChannelParticipant) -> Void, openPeerInfo: @escaping (EnginePeer) -> Void, openKicked: @escaping () -> Void, presentRestrictedPermissionAlert: @escaping (TelegramChatBannedRightsFlags) -> Void, presentConversionToBroadcastGroup: @escaping () -> Void, openChannelExample: @escaping () -> Void, updateSlowmode: @escaping (Int32) -> Void, updateUnrestrictBoosters: @escaping (Int32) -> Void, updateStarsAmount: @escaping (StarsAmount?, Bool) -> Void, toggleIsOptionExpanded: @escaping (TelegramChatBannedRightsFlags) -> Void) {
44+
init(context: AccountContext, updatePermission: @escaping (TelegramChatBannedRightsFlags, Bool) -> Void, setPeerIdWithRevealedOptions: @escaping (EnginePeer.Id?, EnginePeer.Id?) -> Void, addPeer: @escaping () -> Void, removePeer: @escaping (EnginePeer.Id) -> Void, openPeer: @escaping (ChannelParticipant) -> Void, openPeerInfo: @escaping (EnginePeer) -> Void, openKicked: @escaping () -> Void, presentRestrictedPermissionAlert: @escaping (TelegramChatBannedRightsFlags) -> Void, presentConversionToBroadcastGroup: @escaping () -> Void, openChannelExample: @escaping () -> Void, updateSlowmode: @escaping (Int32) -> Void, updateUnrestrictBoosters: @escaping (Int32) -> Void, updateStarsAmount: @escaping (StarsAmount?, Bool) -> Void, openSetCustomStarsAmount: @escaping () -> Void, toggleIsOptionExpanded: @escaping (TelegramChatBannedRightsFlags) -> Void) {
4445
self.context = context
4546
self.updatePermission = updatePermission
4647
self.addPeer = addPeer
@@ -55,6 +56,7 @@ private final class ChannelPermissionsControllerArguments {
5556
self.updateSlowmode = updateSlowmode
5657
self.updateUnrestrictBoosters = updateUnrestrictBoosters
5758
self.updateStarsAmount = updateStarsAmount
59+
self.openSetCustomStarsAmount = openSetCustomStarsAmount
5860
self.toggleIsOptionExpanded = toggleIsOptionExpanded
5961
}
6062
}
@@ -427,7 +429,7 @@ private enum ChannelPermissionsEntry: ItemListNodeEntry {
427429
case let .messagePrice(_, value, maxValue, price):
428430
return MessagePriceItem(theme: presentationData.theme, strings: presentationData.strings, isEnabled: true, minValue: 1, maxValue: maxValue, value: value, price: price, sectionId: self.section, updated: { value, apply in
429431
arguments.updateStarsAmount(StarsAmount(value: value, nanos: 0), apply)
430-
})
432+
}, openSetCustom: nil)
431433
case let .messagePriceInfo(_, value):
432434
return ItemListTextItem(presentationData: presentationData, text: .plain(value), sectionId: self.section)
433435
case let .unrestrictBoostersSwitch(_, title, value):
@@ -1267,6 +1269,7 @@ public func channelPermissionsController(context: AccountContext, updatedPresent
12671269
|> deliverOnMainQueue).start())
12681270
})
12691271
}
1272+
}, openSetCustomStarsAmount: {
12701273
}, toggleIsOptionExpanded: { flags in
12711274
updateState { state in
12721275
var state = state

submodules/SettingsUI/Sources/Privacy and Security/IncomingMessagePrivacyScreen.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,24 @@ private final class IncomingMessagePrivacyScreenArguments {
2020
let infoLinkAction: () -> Void
2121
let openExceptions: () -> Void
2222
let openPremiumInfo: () -> Void
23+
let openSetCustomStarsAmount: () -> Void
2324

2425
init(
2526
context: AccountContext,
2627
updateValue: @escaping (GlobalPrivacySettings.NonContactChatsPrivacy) -> Void,
2728
disabledValuePressed: @escaping () -> Void,
2829
infoLinkAction: @escaping () -> Void,
2930
openExceptions: @escaping () -> Void,
30-
openPremiumInfo: @escaping () -> Void
31+
openPremiumInfo: @escaping () -> Void,
32+
openSetCustomStarsAmount: @escaping () -> Void
3133
) {
3234
self.context = context
3335
self.updateValue = updateValue
3436
self.disabledValuePressed = disabledValuePressed
3537
self.infoLinkAction = infoLinkAction
3638
self.openExceptions = openExceptions
3739
self.openPremiumInfo = openPremiumInfo
40+
self.openSetCustomStarsAmount = openSetCustomStarsAmount
3841
}
3942
}
4043

@@ -151,6 +154,8 @@ private enum GlobalAutoremoveEntry: ItemListNodeEntry {
151154
case let .price(value, maxValue, price, isEnabled):
152155
return MessagePriceItem(theme: presentationData.theme, strings: presentationData.strings, isEnabled: isEnabled, minValue: 1, maxValue: maxValue, value: value, price: price, sectionId: self.section, updated: { value, _ in
153156
arguments.updateValue(.paidMessages(StarsAmount(value: value, nanos: 0)))
157+
}, openSetCustom: {
158+
arguments.openSetCustomStarsAmount()
154159
}, openPremiumInfo: {
155160
arguments.openPremiumInfo()
156161
})
@@ -365,6 +370,20 @@ public func incomingMessagePrivacyScreen(context: AccountContext, value: GlobalP
365370
controller?.replace(with: c)
366371
}
367372
pushControllerImpl?(controller)
373+
},
374+
openSetCustomStarsAmount: {
375+
var currentAmount: StarsAmount = StarsAmount(value: 1, nanos: 0)
376+
if case let .paidMessages(value) = stateValue.with({ $0 }).updatedValue {
377+
currentAmount = value
378+
}
379+
let starsScreen = context.sharedContext.makeStarsWithdrawalScreen(context: context, subject: .enterAmount(current: currentAmount), completion: { amount in
380+
updateState { state in
381+
var state = state
382+
state.updatedValue = .paidMessages(StarsAmount(value: amount, nanos: 0))
383+
return state
384+
}
385+
})
386+
pushControllerImpl?(starsScreen)
368387
}
369388
)
370389

submodules/TelegramCallsUI/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ swift_library(
121121
"//submodules/FastBlur",
122122
"//submodules/InviteLinksUI",
123123
"//third-party/td:TdBinding",
124+
"//submodules/TelegramUI/Components/AnimatedTextComponent",
124125
],
125126
visibility = [
126127
"//visibility:public",

submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,15 @@ private final class ConferenceCallE2EContextStateImpl: ConferenceCallE2EContextS
335335
func getParticipants() -> [ConferenceCallE2EContext.BlockchainParticipant] {
336336
return self.call.participants().map { ConferenceCallE2EContext.BlockchainParticipant(userId: $0.userId, internalId: $0.internalId) }
337337
}
338+
339+
func getParticipantLatencies() -> [Int64: Double] {
340+
let dict = self.call.participantLatencies()
341+
var result: [Int64: Double] = [:]
342+
for (k, v) in dict {
343+
result[k.int64Value] = v.doubleValue
344+
}
345+
return result
346+
}
338347

339348
func getParticipantIds() -> [Int64] {
340349
return self.call.participants().map { $0.userId }

0 commit comments

Comments
 (0)