[WIP] Saved messages

This commit is contained in:
Isaac
2024-01-06 00:43:58 +04:00
parent c2b9891de1
commit 6a89f938db
86 changed files with 1660 additions and 478 deletions

View File

@@ -113,6 +113,7 @@ extension ChatControllerImpl {
if message.areReactionsTags(accountPeerId: self.context.account.peerId) {
//TODO:localize
actions.reactionsTitle = "Tag the message with an emoji for quick access later"
actions.allPresetReactionsAreAvailable = true
}
actions.selectedReactionItems = selectedReactions.reactions
@@ -344,29 +345,23 @@ extension ChatControllerImpl {
isFirst = !currentReactions.contains(where: { $0.value == chosenReaction })
}
/*guard let allowedReactions = allowedReactions else {
itemNode.openMessageContextMenu()
return
}
switch allowedReactions {
case let .set(set):
if !messageAlreadyHasThisReaction && updatedReactions.contains(where: { !set.contains($0) }) {
itemNode.openMessageContextMenu()
return
}
case .all:
break
}*/
if removedReaction == nil, case .custom = chosenReaction {
if let peer = self.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, case .broadcast = peer.info {
} else {
if message.areReactionsTags(accountPeerId: self.context.account.peerId) {
if removedReaction == nil, !topReactions.contains(where: { $0.reaction.rawValue == chosenReaction }) {
if !self.presentationInterfaceState.isPremium {
controller?.premiumReactionsSelected?()
return
}
}
} else {
if removedReaction == nil, case .custom = chosenReaction {
if let peer = self.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, case .broadcast = peer.info {
} else {
if !self.presentationInterfaceState.isPremium {
controller?.premiumReactionsSelected?()
return
}
}
}
}
self.chatDisplayNode.historyNode.forEachItemNode { itemNode in