mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various improvements
This commit is contained in:
@@ -49,6 +49,7 @@ import StoryContainerScreen
|
||||
import FullScreenEffectView
|
||||
import PeerInfoStoryGridScreen
|
||||
import ArchiveInfoScreen
|
||||
import BirthdayPickerScreen
|
||||
|
||||
private final class ContextControllerContentSourceImpl: ContextControllerContentSource {
|
||||
let controller: ViewController
|
||||
@@ -1164,6 +1165,13 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
}
|
||||
}
|
||||
|
||||
self.chatListDisplayNode.mainContainerNode.openBirthdaySetup = { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.openBirthdaySetup()
|
||||
}
|
||||
|
||||
self.chatListDisplayNode.requestOpenMessageFromSearch = { [weak self] peer, threadId, messageId, deactivateOnAction in
|
||||
if let strongSelf = self {
|
||||
strongSelf.openMessageFromSearchDisposable.set((strongSelf.context.engine.peers.ensurePeerIsLocallyAvailable(peer: peer)
|
||||
@@ -5761,6 +5769,41 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
}
|
||||
}
|
||||
|
||||
func openBirthdaySetup() {
|
||||
let context = self.context
|
||||
let _ = context.engine.notices.dismissServerProvidedSuggestion(suggestion: .setupBirthday).startStandalone()
|
||||
|
||||
let settingsPromise: Promise<AccountPrivacySettings?>
|
||||
if let rootController = self.context.sharedContext.mainWindow?.viewController as? TelegramRootControllerInterface, let current = rootController.getPrivacySettings() {
|
||||
settingsPromise = current
|
||||
} else {
|
||||
settingsPromise = Promise()
|
||||
settingsPromise.set(.single(nil) |> then(context.engine.privacy.requestAccountPrivacySettings() |> map(Optional.init)))
|
||||
}
|
||||
let controller = BirthdayPickerScreen(context: context, settings: settingsPromise.get(), openSettings: { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.context.sharedContext.makeBirthdayPrivacyController(context: self.context, settings: settingsPromise, openedFromBirthdayScreen: true, present: { [weak self] c in
|
||||
self?.push(c)
|
||||
})
|
||||
}, completion: { [weak self] value in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
|
||||
let _ = context.engine.accountData.updateBirthday(birthday: value).startStandalone()
|
||||
|
||||
//TODO:localize
|
||||
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
|
||||
self.present(UndoOverlayController(presentationData: presentationData, content: .actionSucceeded(title: nil, text: self.presentationData.strings.Birthday_Added, cancel: nil, destructive: false), elevatedLayout: false, action: { _ in
|
||||
return true
|
||||
}), in: .current)
|
||||
})
|
||||
self.push(controller)
|
||||
//self.present(controller, in: .current)
|
||||
}
|
||||
|
||||
private var storyCameraTransitionInCoordinator: StoryCameraTransitionInCoordinator?
|
||||
var hasStoryCameraTransition: Bool {
|
||||
return self.storyCameraTransitionInCoordinator != nil
|
||||
|
||||
Reference in New Issue
Block a user