Skip to content

Commit dd22272

Browse files
committed
Merge branches 'master' and 'master' of gitlab.com:peter-iakovlev/telegram-ios
2 parents 4a9258c + 313833b commit dd22272

File tree

134 files changed

+3768
-1221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3768
-1221
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ submodules/TelegramCore/FlatSerialization/Sources/*
7272
buildServer.json
7373
.build/**
7474
Telegram.LSP.json
75+
**/.build/**

.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: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,16 @@ public enum SendInviteLinkScreenSubject {
995995
case groupCall(link: String)
996996
}
997997

998+
public enum StarsWithdrawalScreenSubject {
999+
public enum PaidMessageKind {
1000+
case privacy
1001+
case postSuggestion
1002+
}
1003+
1004+
case withdraw
1005+
case enterAmount(current: StarsAmount, minValue: StarsAmount, fractionAfterCommission: Int, kind: PaidMessageKind)
1006+
}
1007+
9981008
public protocol SharedAccountContext: AnyObject {
9991009
var sharedContainerPath: String { get }
10001010
var basePath: String { get }
@@ -1179,7 +1189,7 @@ public protocol SharedAccountContext: AnyObject {
11791189
func makeStarsStatisticsScreen(context: AccountContext, peerId: EnginePeer.Id, revenueContext: StarsRevenueStatsContext) -> ViewController
11801190
func makeStarsAmountScreen(context: AccountContext, initialValue: Int64?, completion: @escaping (Int64) -> Void) -> ViewController
11811191
func makeStarsWithdrawalScreen(context: AccountContext, stats: StarsRevenueStats, completion: @escaping (Int64) -> Void) -> ViewController
1182-
func makeStarsWithdrawalScreen(context: AccountContext, completion: @escaping (Int64) -> Void) -> ViewController
1192+
func makeStarsWithdrawalScreen(context: AccountContext, subject: StarsWithdrawalScreenSubject, completion: @escaping (Int64) -> Void) -> ViewController
11831193
func makeStarGiftResellScreen(context: AccountContext, update: Bool, completion: @escaping (Int64) -> Void) -> ViewController
11841194
func makeStarsGiftScreen(context: AccountContext, message: EngineMessage) -> ViewController
11851195
func makeStarsGiveawayBoostScreen(context: AccountContext, peerId: EnginePeer.Id, boost: ChannelBoostersContext.State.Boost) -> ViewController
@@ -1212,9 +1222,10 @@ public protocol SharedAccountContext: AnyObject {
12121222
func makeGalleryController(context: AccountContext, source: GalleryControllerItemSource, streamSingleVideo: Bool, isPreview: Bool) -> ViewController
12131223

12141224
func makeAccountFreezeInfoScreen(context: AccountContext) -> ViewController
1215-
12161225
func makeSendInviteLinkScreen(context: AccountContext, subject: SendInviteLinkScreenSubject, peers: [TelegramForbiddenInvitePeer], theme: PresentationTheme?) -> ViewController
12171226

1227+
func makePostSuggestionsSettingsScreen(context: AccountContext) -> ViewController
1228+
12181229
func makeDebugSettingsController(context: AccountContext?) -> ViewController?
12191230

12201231
func openCreateGroupCallUI(context: AccountContext, peerIds: [EnginePeer.Id], parentController: ViewController)

submodules/AccountContext/Sources/ChatController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ public enum ChatCustomContentsKind: Equatable {
11661166
case quickReplyMessageInput(shortcut: String, shortcutType: ChatQuickReplyShortcutType)
11671167
case businessLinkSetup(link: TelegramBusinessChatLinks.Link)
11681168
case hashTagSearch(publicPosts: Bool)
1169+
case postSuggestions(price: StarsAmount)
11691170
}
11701171

11711172
public protocol ChatCustomContentsProtocol: AnyObject {

submodules/AttachmentUI/Sources/AttachmentPanel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,7 @@ final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate {
12431243
}, joinGroupCall: { _ in
12441244
}, presentInviteMembers: {
12451245
}, presentGigagroupHelp: {
1246+
}, openSuggestPost: {
12461247
}, editMessageMedia: { _, _ in
12471248
}, updateShowCommands: { _ in
12481249
}, updateShowSendAsPeers: { _ in

submodules/ChatListUI/Sources/ChatListController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,13 +2501,13 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
25012501
guard let strongSelf = self else {
25022502
return
25032503
}
2504-
strongSelf.dismissAutoarchiveDisposable.set(strongSelf.context.engine.notices.dismissServerProvidedSuggestion(suggestion: .autoarchivePopular).startStrict())
2504+
strongSelf.dismissAutoarchiveDisposable.set(strongSelf.context.engine.notices.dismissServerProvidedSuggestion(suggestion: ServerProvidedSuggestion.autoarchivePopular.id).startStrict())
25052505
}),
25062506
TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.ChatList_AutoarchiveSuggestion_OpenSettings, action: {
25072507
guard let strongSelf = self else {
25082508
return
25092509
}
2510-
strongSelf.dismissAutoarchiveDisposable.set(strongSelf.context.engine.notices.dismissServerProvidedSuggestion(suggestion: .autoarchivePopular).startStrict())
2510+
strongSelf.dismissAutoarchiveDisposable.set(strongSelf.context.engine.notices.dismissServerProvidedSuggestion(suggestion: ServerProvidedSuggestion.autoarchivePopular.id).startStrict())
25112511
strongSelf.push(strongSelf.context.sharedContext.makePrivacyAndSecurityController(context: strongSelf.context))
25122512
})
25132513
], actionLayout: .vertical, parseMarkdown: true), in: .window(.root))
@@ -6114,7 +6114,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
61146114

61156115
func openBirthdaySetup() {
61166116
let context = self.context
6117-
let _ = context.engine.notices.dismissServerProvidedSuggestion(suggestion: .setupBirthday).startStandalone()
6117+
let _ = context.engine.notices.dismissServerProvidedSuggestion(suggestion: ServerProvidedSuggestion.setupBirthday.id).startStandalone()
61186118

61196119
let settingsPromise: Promise<AccountPrivacySettings?>
61206120
if let rootController = self.context.sharedContext.mainWindow?.viewController as? TelegramRootControllerInterface, let current = rootController.getPrivacySettings() {

submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,6 +3368,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
33683368
}, openAdInfo: { node, adPeer in
33693369
interaction.openAdInfo(node, adPeer)
33703370
}, openAccountFreezeInfo: {
3371+
}, openUrl: { _ in
33713372
})
33723373
chatListInteraction.isSearchMode = true
33733374

@@ -5363,6 +5364,7 @@ public final class ChatListSearchShimmerNode: ASDisplayNode {
53635364
}, openPhotoSetup: {
53645365
}, openAdInfo: { _, _ in
53655366
}, openAccountFreezeInfo: {
5367+
}, openUrl: { _ in
53665368
})
53675369
var isInlineMode = false
53685370
if case .topics = key {

submodules/ChatListUI/Sources/ChatListShimmerNode.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public final class ChatListShimmerNode: ASDisplayNode {
163163
}, openPhotoSetup: {
164164
}, openAdInfo: { _, _ in
165165
}, openAccountFreezeInfo: {
166+
}, openUrl: { _ in
166167
})
167168
interaction.isInlineMode = isInlineMode
168169

0 commit comments

Comments
 (0)