mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Allow archiving chats in folders that exclude archived chats
This commit is contained in:
parent
b1eb59c2f0
commit
1014179d45
@ -234,12 +234,25 @@ private func revealOptions(strings: PresentationStrings, theme: PresentationThem
|
|||||||
if canDelete {
|
if canDelete {
|
||||||
options.append(ItemListRevealOption(key: RevealOptionKey.delete.rawValue, title: strings.Common_Delete, icon: deleteIcon, color: theme.list.itemDisclosureActions.destructive.fillColor, textColor: theme.list.itemDisclosureActions.destructive.foregroundColor))
|
options.append(ItemListRevealOption(key: RevealOptionKey.delete.rawValue, title: strings.Common_Delete, icon: deleteIcon, color: theme.list.itemDisclosureActions.destructive.fillColor, textColor: theme.list.itemDisclosureActions.destructive.foregroundColor))
|
||||||
}
|
}
|
||||||
if !isEditing && filterData == nil {
|
if !isEditing {
|
||||||
if case .root = groupId {
|
var canArchive = false
|
||||||
|
var canUnarchive = false
|
||||||
|
if let filterData = filterData {
|
||||||
|
if filterData.excludesArchived {
|
||||||
|
canArchive = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if case .root = groupId {
|
||||||
|
canArchive = true
|
||||||
|
} else {
|
||||||
|
canUnarchive = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if canArchive {
|
||||||
if canArchivePeer(id: peerId, accountPeerId: accountPeerId) {
|
if canArchivePeer(id: peerId, accountPeerId: accountPeerId) {
|
||||||
options.append(ItemListRevealOption(key: RevealOptionKey.archive.rawValue, title: strings.ChatList_ArchiveAction, icon: archiveIcon, color: theme.list.itemDisclosureActions.inactive.fillColor, textColor: theme.list.itemDisclosureActions.inactive.foregroundColor))
|
options.append(ItemListRevealOption(key: RevealOptionKey.archive.rawValue, title: strings.ChatList_ArchiveAction, icon: archiveIcon, color: theme.list.itemDisclosureActions.inactive.fillColor, textColor: theme.list.itemDisclosureActions.inactive.foregroundColor))
|
||||||
}
|
}
|
||||||
} else {
|
} else if canUnarchive {
|
||||||
options.append(ItemListRevealOption(key: RevealOptionKey.unarchive.rawValue, title: strings.ChatList_UnarchiveAction, icon: unarchiveIcon, color: theme.list.itemDisclosureActions.inactive.fillColor, textColor: theme.list.itemDisclosureActions.inactive.foregroundColor))
|
options.append(ItemListRevealOption(key: RevealOptionKey.unarchive.rawValue, title: strings.ChatList_UnarchiveAction, icon: unarchiveIcon, color: theme.list.itemDisclosureActions.inactive.fillColor, textColor: theme.list.itemDisclosureActions.inactive.foregroundColor))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user