mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 05:51:42 +00:00
[Temp]
This commit is contained in:
parent
8a47556a00
commit
1634fa061c
@ -636,6 +636,10 @@ public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
longPressRecognizer.minimumPressDuration = 0.2
|
longPressRecognizer.minimumPressDuration = 0.2
|
||||||
self.longPressRecognizer = longPressRecognizer
|
self.longPressRecognizer = longPressRecognizer
|
||||||
self.view.addGestureRecognizer(longPressRecognizer)
|
self.view.addGestureRecognizer(longPressRecognizer)
|
||||||
|
|
||||||
|
if self.allPresetReactionsAreAvailable {
|
||||||
|
longPressRecognizer.isEnabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func horizontalExpandGesture(_ recognizer: UIPanGestureRecognizer) {
|
@objc private func horizontalExpandGesture(_ recognizer: UIPanGestureRecognizer) {
|
||||||
|
|||||||
@ -1116,7 +1116,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let hasRecentEmoji = ![.reaction(onlyTop: true), .reaction(onlyTop: false), .quickReaction, .status, .profilePhoto, .groupPhoto, .topicIcon, .backgroundIcon, .reactionList].contains(subject)
|
let hasRecentEmoji = ![.reaction(onlyTop: true), .reaction(onlyTop: false), .quickReaction, .status, .profilePhoto, .groupPhoto, .topicIcon, .backgroundIcon, .reactionList, .messageTag].contains(subject)
|
||||||
|
|
||||||
if let recentEmoji = recentEmoji, hasRecentEmoji {
|
if let recentEmoji = recentEmoji, hasRecentEmoji {
|
||||||
for item in recentEmoji.items {
|
for item in recentEmoji.items {
|
||||||
@ -1381,7 +1381,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
var displaySearchWithPlaceholder: String?
|
var displaySearchWithPlaceholder: String?
|
||||||
let searchInitiallyHidden = true
|
let searchInitiallyHidden = true
|
||||||
if hasSearch {
|
if hasSearch {
|
||||||
if [.reaction(onlyTop: false), .quickReaction].contains(subject) {
|
if [.reaction(onlyTop: false), .quickReaction, .messageTag].contains(subject) {
|
||||||
displaySearchWithPlaceholder = strings.EmojiSearch_SearchReactionsPlaceholder
|
displaySearchWithPlaceholder = strings.EmojiSearch_SearchReactionsPlaceholder
|
||||||
} else if case .status = subject {
|
} else if case .status = subject {
|
||||||
displaySearchWithPlaceholder = strings.EmojiSearch_SearchStatusesPlaceholder
|
displaySearchWithPlaceholder = strings.EmojiSearch_SearchStatusesPlaceholder
|
||||||
@ -1436,7 +1436,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
let warpContentsOnEdges = [.reaction(onlyTop: true), .reaction(onlyTop: false), .quickReaction, .status, .channelStatus, .profilePhoto, .groupPhoto, .backgroundIcon].contains(subject)
|
let warpContentsOnEdges = [.reaction(onlyTop: true), .reaction(onlyTop: false), .quickReaction, .status, .channelStatus, .profilePhoto, .groupPhoto, .backgroundIcon, .messageTag].contains(subject)
|
||||||
let enableLongPress = [.reaction(onlyTop: true), .reaction(onlyTop: false), .status, .channelStatus].contains(subject)
|
let enableLongPress = [.reaction(onlyTop: true), .reaction(onlyTop: false), .status, .channelStatus].contains(subject)
|
||||||
|
|
||||||
return EmojiPagerContentComponent(
|
return EmojiPagerContentComponent(
|
||||||
|
|||||||
@ -158,7 +158,7 @@ extension ChatControllerImpl {
|
|||||||
animationCache: animationCache,
|
animationCache: animationCache,
|
||||||
animationRenderer: animationRenderer,
|
animationRenderer: animationRenderer,
|
||||||
isStandalone: false,
|
isStandalone: false,
|
||||||
subject: .reaction(onlyTop: false),
|
subject: message.areReactionsTags(accountPeerId: self.context.account.peerId) ? .messageTag : .reaction(onlyTop: false),
|
||||||
hasTrending: false,
|
hasTrending: false,
|
||||||
topReactionItems: reactionItems,
|
topReactionItems: reactionItems,
|
||||||
areUnicodeEmojiEnabled: false,
|
areUnicodeEmojiEnabled: false,
|
||||||
|
|||||||
@ -6948,6 +6948,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
self.chatDisplayNode.historyNode.voicePlaylistItemChanged(nil, currentItem)
|
self.chatDisplayNode.historyNode.voicePlaylistItemChanged(nil, currentItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.chatDisplayNode.historyNode.beganDragging = { [weak self] in
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if self.presentationInterfaceState.search != nil && self.presentationInterfaceState.historyFilter != nil {
|
||||||
|
self.chatDisplayNode.dismissInput()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.chatDisplayNode.historyNode.didScrollWithOffset = { [weak self] offset, transition, itemNode, isTracking in
|
self.chatDisplayNode.historyNode.didScrollWithOffset = { [weak self] offset, transition, itemNode, isTracking in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
@ -7927,7 +7936,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mappedTransition = (ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: deleteItems, insertItems: insertItems, updateItems: transition.updateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: transition.peerType, networkType: transition.networkType, animateIn: false, reason: transition.reason, flashIndicators: transition.flashIndicators), updateSizeAndInsets)
|
mappedTransition = (ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: deleteItems, insertItems: insertItems, updateItems: transition.updateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: transition.peerType, networkType: transition.networkType, animateIn: false, reason: transition.reason, flashIndicators: transition.flashIndicators, animateFromPreviousFilter: false), updateSizeAndInsets)
|
||||||
}, updateExtraNavigationBarBackgroundHeight: { value, hitTestSlop, _ in
|
}, updateExtraNavigationBarBackgroundHeight: { value, hitTestSlop, _ in
|
||||||
strongSelf.additionalNavigationBarBackgroundHeight = value
|
strongSelf.additionalNavigationBarBackgroundHeight = value
|
||||||
strongSelf.additionalNavigationBarHitTestSlop = hitTestSlop
|
strongSelf.additionalNavigationBarHitTestSlop = hitTestSlop
|
||||||
|
|||||||
@ -144,6 +144,7 @@ struct ChatHistoryListViewTransition {
|
|||||||
var animateIn: Bool
|
var animateIn: Bool
|
||||||
var reason: ChatHistoryViewTransitionReason
|
var reason: ChatHistoryViewTransitionReason
|
||||||
var flashIndicators: Bool
|
var flashIndicators: Bool
|
||||||
|
var animateFromPreviousFilter: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
private func maxMessageIndexForEntries(_ view: ChatHistoryView, indexRange: (Int, Int)) -> (incoming: MessageIndex?, overall: MessageIndex?) {
|
private func maxMessageIndexForEntries(_ view: ChatHistoryView, indexRange: (Int, Int)) -> (incoming: MessageIndex?, overall: MessageIndex?) {
|
||||||
@ -299,8 +300,8 @@ private func mappedUpdateEntries(context: AccountContext, chatLocation: ChatLoca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func mappedChatHistoryViewListTransition(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, lastHeaderId: Int64, transition: ChatHistoryViewTransition) -> ChatHistoryListViewTransition {
|
private func mappedChatHistoryViewListTransition(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, lastHeaderId: Int64, animateFromPreviousFilter: Bool, transition: ChatHistoryViewTransition) -> ChatHistoryListViewTransition {
|
||||||
return ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, animateIn: transition.animateIn, reason: transition.reason, flashIndicators: transition.flashIndicators)
|
return ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, animateIn: transition.animateIn, reason: transition.reason, flashIndicators: transition.flashIndicators, animateFromPreviousFilter: animateFromPreviousFilter)
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class ChatHistoryTransactionOpaqueState {
|
private final class ChatHistoryTransactionOpaqueState {
|
||||||
@ -1744,10 +1745,6 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if resetScrolling {
|
|
||||||
resetScrolling = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if let strongSelf = self, updatedScrollPosition == nil, case .InteractiveChanges = reason, case let .known(offset) = strongSelf.visibleContentOffset(), abs(offset) <= 0.9, let previous = previous {
|
if let strongSelf = self, updatedScrollPosition == nil, case .InteractiveChanges = reason, case let .known(offset) = strongSelf.visibleContentOffset(), abs(offset) <= 0.9, let previous = previous {
|
||||||
var fillsScreen = true
|
var fillsScreen = true
|
||||||
switch strongSelf.visibleBottomContentOffset() {
|
switch strongSelf.visibleBottomContentOffset() {
|
||||||
@ -1827,7 +1824,7 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
|||||||
}
|
}
|
||||||
|
|
||||||
let rawTransition = preparedChatHistoryViewTransition(from: previous, to: processedView, reason: reason, reverse: reverse, chatLocation: chatLocation, controllerInteraction: controllerInteraction, scrollPosition: updatedScrollPosition, scrollAnimationCurve: scrollAnimationCurve, initialData: initialData?.initialData, keyboardButtonsMessage: keyboardButtonsMessage, cachedData: initialData?.cachedData, cachedDataMessages: initialData?.cachedDataMessages, readStateData: initialData?.readStateData, flashIndicators: flashIndicators, updatedMessageSelection: previousSelectedMessages != selectedMessages, messageTransitionNode: messageTransitionNode(), allUpdated: updateAllOnEachVersion || forceUpdateAll)
|
let rawTransition = preparedChatHistoryViewTransition(from: previous, to: processedView, reason: reason, reverse: reverse, chatLocation: chatLocation, controllerInteraction: controllerInteraction, scrollPosition: updatedScrollPosition, scrollAnimationCurve: scrollAnimationCurve, initialData: initialData?.initialData, keyboardButtonsMessage: keyboardButtonsMessage, cachedData: initialData?.cachedData, cachedDataMessages: initialData?.cachedDataMessages, readStateData: initialData?.readStateData, flashIndicators: flashIndicators, updatedMessageSelection: previousSelectedMessages != selectedMessages, messageTransitionNode: messageTransitionNode(), allUpdated: updateAllOnEachVersion || forceUpdateAll)
|
||||||
var mappedTransition = mappedChatHistoryViewListTransition(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, transition: rawTransition)
|
var mappedTransition = mappedChatHistoryViewListTransition(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, animateFromPreviousFilter: resetScrolling, transition: rawTransition)
|
||||||
|
|
||||||
if disableAnimations {
|
if disableAnimations {
|
||||||
mappedTransition.options.remove(.AnimateInsertion)
|
mappedTransition.options.remove(.AnimateInsertion)
|
||||||
@ -1839,6 +1836,10 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
|||||||
mappedTransition.options.insert(.Synchronous)
|
mappedTransition.options.insert(.Synchronous)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if resetScrolling {
|
||||||
|
resetScrolling = false
|
||||||
|
}
|
||||||
|
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
@ -3154,6 +3155,11 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
|||||||
|
|
||||||
let animated = transition.options.contains(.AnimateInsertion)
|
let animated = transition.options.contains(.AnimateInsertion)
|
||||||
|
|
||||||
|
var previousCloneView: UIView?
|
||||||
|
if transition.animateFromPreviousFilter {
|
||||||
|
previousCloneView = self.view.snapshotView(afterScreenUpdates: false)
|
||||||
|
}
|
||||||
|
|
||||||
let completion: (Bool, ListViewDisplayedItemRange) -> Void = { [weak self] wasTransformed, visibleRange in
|
let completion: (Bool, ListViewDisplayedItemRange) -> Void = { [weak self] wasTransformed, visibleRange in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.currentAppliedDeleteAnimationCorrelationIds.removeAll()
|
strongSelf.currentAppliedDeleteAnimationCorrelationIds.removeAll()
|
||||||
@ -3496,6 +3502,17 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
|||||||
|
|
||||||
strongSelf.hasActiveTransition = false
|
strongSelf.hasActiveTransition = false
|
||||||
|
|
||||||
|
if let previousCloneView {
|
||||||
|
previousCloneView.transform = strongSelf.view.transform
|
||||||
|
previousCloneView.center = strongSelf.view.center
|
||||||
|
previousCloneView.bounds = strongSelf.view.bounds
|
||||||
|
strongSelf.view.superview?.insertSubview(previousCloneView, belowSubview: strongSelf.view)
|
||||||
|
strongSelf.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
|
previousCloneView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak previousCloneView] _ in
|
||||||
|
previousCloneView?.removeFromSuperview()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
strongSelf.dequeueHistoryViewTransitions()
|
strongSelf.dequeueHistoryViewTransitions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -810,7 +810,7 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
|||||||
canSelect: canSelect && !isEmbeddedMode,
|
canSelect: canSelect && !isEmbeddedMode,
|
||||||
resourceStatus: resourceStatus,
|
resourceStatus: resourceStatus,
|
||||||
messageActions: isEmbeddedMode ? ChatAvailableMessageActions(
|
messageActions: isEmbeddedMode ? ChatAvailableMessageActions(
|
||||||
options: [],
|
options: messageActions.options.intersection([.deleteLocally, .deleteGlobally]),
|
||||||
banAuthor: nil,
|
banAuthor: nil,
|
||||||
disableDelete: true,
|
disableDelete: true,
|
||||||
isCopyProtected: messageActions.isCopyProtected
|
isCopyProtected: messageActions.isCopyProtected
|
||||||
|
|||||||
@ -93,10 +93,6 @@ func topMessageReactions(context: AccountContext, message: Message) -> Signal<[R
|
|||||||
loadTags = true
|
loadTags = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if "".isEmpty {
|
|
||||||
loadTags = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if loadTags {
|
if loadTags {
|
||||||
return tagMessageReactions(context: context)
|
return tagMessageReactions(context: context)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user