mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
- Forum improvements
- Global autoremove settings
This commit is contained in:
@@ -28,6 +28,7 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
private let params: ContactMultiselectionControllerParams
|
||||
private let context: AccountContext
|
||||
private let mode: ContactMultiselectionControllerMode
|
||||
private let isPeerEnabled: ((EnginePeer) -> Bool)?
|
||||
|
||||
private let titleView: CounterContollerTitleView
|
||||
|
||||
@@ -83,6 +84,7 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
self.params = params
|
||||
self.context = params.context
|
||||
self.mode = params.mode
|
||||
self.isPeerEnabled = params.isPeerEnabled
|
||||
self.options = params.options
|
||||
self.filters = params.filters
|
||||
self.limit = params.limit
|
||||
@@ -127,7 +129,9 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
})
|
||||
|
||||
switch self.mode {
|
||||
case let .chatSelection(_, selectedChats, additionalCategories, _):
|
||||
case let .chatSelection(chatSelection):
|
||||
let selectedChats = chatSelection.selectedChats
|
||||
let additionalCategories = chatSelection.additionalCategories
|
||||
let _ = (self.context.engine.data.get(
|
||||
EngineDataList(
|
||||
selectedChats.map(TelegramEngine.EngineData.Item.Peer.Peer.init)
|
||||
@@ -207,8 +211,8 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(cancelPressed))
|
||||
self.navigationItem.rightBarButtonItem = self.rightNavigationButton
|
||||
rightNavigationButton.isEnabled = false
|
||||
case let .chatSelection(title, _, _, _):
|
||||
self.titleView.title = CounterContollerTitle(title: title, counter: "")
|
||||
case let .chatSelection(chatSelection):
|
||||
self.titleView.title = CounterContollerTitle(title: chatSelection.title, counter: "")
|
||||
let rightNavigationButton = UIBarButtonItem(title: self.presentationData.strings.Common_Done, style: .done, target: self, action: #selector(self.rightNavigationButtonPressed))
|
||||
self.rightNavigationButton = rightNavigationButton
|
||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(cancelPressed))
|
||||
@@ -218,7 +222,7 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
}
|
||||
|
||||
override func loadDisplayNode() {
|
||||
self.displayNode = ContactMultiselectionControllerNode(navigationBar: self.navigationBar, context: self.context, presentationData: self.presentationData, mode: self.mode, options: self.options, filters: self.filters, limit: self.limit, reachedSelectionLimit: self.params.reachedLimit)
|
||||
self.displayNode = ContactMultiselectionControllerNode(navigationBar: self.navigationBar, context: self.context, presentationData: self.presentationData, mode: self.mode, isPeerEnabled: self.isPeerEnabled, options: self.options, filters: self.filters, limit: self.limit, reachedSelectionLimit: self.params.reachedLimit)
|
||||
switch self.contactsNode.contentNode {
|
||||
case let .contacts(contactsNode):
|
||||
self._listReady.set(contactsNode.ready)
|
||||
@@ -440,8 +444,8 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
|
||||
break
|
||||
case let .chats(chatsNode):
|
||||
var categoryToken: EditableTokenListToken?
|
||||
if case let .chatSelection(_, _, additionalCategories, _) = strongSelf.mode {
|
||||
if let additionalCategories = additionalCategories {
|
||||
if case let .chatSelection(chatSelection) = strongSelf.mode {
|
||||
if let additionalCategories = chatSelection.additionalCategories {
|
||||
for i in 0 ..< additionalCategories.categories.count {
|
||||
if additionalCategories.categories[i].id == id {
|
||||
categoryToken = EditableTokenListToken(id: id, title: additionalCategories.categories[i].title, fixedPosition: i)
|
||||
|
||||
Reference in New Issue
Block a user