Cherry-pick session review changes

This commit is contained in:
Ali
2023-09-06 22:53:37 +04:00
parent 0b6ad230d8
commit 1a3f8c1faf
8 changed files with 105 additions and 15 deletions

View File

@@ -23,8 +23,6 @@ import ChatListHeaderComponent
import UndoUI
import NewSessionInfoScreen
private var debugDidAddNewSessionReview = false
public enum ChatListNodeMode {
case chatList(appendContacts: Bool)
case peers(filter: ChatListNodePeersFilter, isSelecting: Bool, additionalCategories: [ChatListNodeAdditionalCategory], chatListFilters: [ChatListFilter]?, displayAutoremoveTimeout: Bool, displayPresence: Bool)
@@ -1637,11 +1635,11 @@ public final class ChatListNode: ListView {
return true
}))
let _ = removeNewSessionReviews(postbox: self.context.account.postbox, ids: [newSessionReview.id]).start()
let _ = self.context.engine.privacy.confirmNewSessionReview(id: newSessionReview.id)
} else {
self.push?(NewSessionInfoScreen(context: self.context, newSessionReview: newSessionReview))
let _ = removeNewSessionReviews(postbox: self.context.account.postbox, ids: [newSessionReview.id]).start()
let _ = self.context.engine.privacy.terminateAnotherSession(id: newSessionReview.id).start()
}
}, openChatFolderUpdates: { [weak self] in
guard let self else {
@@ -1743,12 +1741,7 @@ public final class ChatListNode: ListView {
let suggestedChatListNotice: Signal<ChatListNotice?, NoError>
if case .chatList(groupId: .root) = location, chatListFilter == nil {
#if DEBUG
if !debugDidAddNewSessionReview {
debugDidAddNewSessionReview = true
let _ = addNewSessionReview(postbox: context.account.postbox, item: NewSessionReview(id: 1, device: "iPhone 14 Pro", location: "Dubai, UAE")).start()
}
#endif
let _ = context.engine.privacy.cleanupSessionReviews().start()
suggestedChatListNotice = .single(nil)
|> then (
@@ -2952,6 +2945,15 @@ public final class ChatListNode: ListView {
}
}
self.dynamicVisualInsets = { [weak self] in
guard let self else {
return UIEdgeInsets()
}
let _ = self
return UIEdgeInsets()
}
self.pollFilterUpdates()
self.resetFilter()