Update tab design

This commit is contained in:
Ali
2020-03-06 18:02:38 +04:00
parent c969f2556d
commit a29dc35c68
29 changed files with 2239 additions and 1042 deletions

View File

@@ -32,7 +32,11 @@ struct ChatListNodeViewUpdate {
func chatListFilterPredicate(filter: ChatListFilterData) -> ChatListFilterPredicate {
let includePeers = Set(filter.includePeers)
let excludePeers = Set(filter.excludePeers)
return ChatListFilterPredicate(includePeerIds: includePeers, excludePeerIds: excludePeers, include: { peer, notificationSettings, isUnread, isContact, isArchived in
var includeAdditionalPeerGroupIds: [PeerGroupId] = []
if !filter.excludeArchived {
includeAdditionalPeerGroupIds.append(Namespaces.PeerGroup.archive)
}
return ChatListFilterPredicate(includePeerIds: includePeers, excludePeerIds: excludePeers, includeAdditionalPeerGroupIds: includeAdditionalPeerGroupIds, include: { peer, notificationSettings, isUnread, isContact in
if filter.excludeRead {
if !isUnread {
return false
@@ -47,11 +51,6 @@ func chatListFilterPredicate(filter: ChatListFilterData) -> ChatListFilterPredic
return false
}
}
if filter.excludeArchived {
if isArchived {
return false
}
}
if !filter.categories.contains(.contacts) && isContact {
if let user = peer as? TelegramUser {
if user.botInfo == nil {
@@ -77,23 +76,12 @@ func chatListFilterPredicate(filter: ChatListFilterData) -> ChatListFilterPredic
}
}
}
if !filter.categories.contains(.smallGroups) {
if !filter.categories.contains(.groups) {
if let _ = peer as? TelegramGroup {
return false
} else if let channel = peer as? TelegramChannel {
if case .group = channel.info {
if channel.username == nil {
return false
}
}
}
}
if !filter.categories.contains(.largeGroups) {
if let channel = peer as? TelegramChannel {
if case .group = channel.info {
if channel.username != nil {
return false
}
return false
}
}
}