mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +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
|
||||
self.longPressRecognizer = longPressRecognizer
|
||||
self.view.addGestureRecognizer(longPressRecognizer)
|
||||
|
||||
if self.allPresetReactionsAreAvailable {
|
||||
longPressRecognizer.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@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 {
|
||||
for item in recentEmoji.items {
|
||||
@ -1381,7 +1381,7 @@ public extension EmojiPagerContentComponent {
|
||||
var displaySearchWithPlaceholder: String?
|
||||
let searchInitiallyHidden = true
|
||||
if hasSearch {
|
||||
if [.reaction(onlyTop: false), .quickReaction].contains(subject) {
|
||||
if [.reaction(onlyTop: false), .quickReaction, .messageTag].contains(subject) {
|
||||
displaySearchWithPlaceholder = strings.EmojiSearch_SearchReactionsPlaceholder
|
||||
} else if case .status = subject {
|
||||
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)
|
||||
|
||||
return EmojiPagerContentComponent(
|
||||
|
@ -158,7 +158,7 @@ extension ChatControllerImpl {
|
||||
animationCache: animationCache,
|
||||
animationRenderer: animationRenderer,
|
||||
isStandalone: false,
|
||||
subject: .reaction(onlyTop: false),
|
||||
subject: message.areReactionsTags(accountPeerId: self.context.account.peerId) ? .messageTag : .reaction(onlyTop: false),
|
||||
hasTrending: false,
|
||||
topReactionItems: reactionItems,
|
||||
areUnicodeEmojiEnabled: false,
|
||||
|
@ -6947,6 +6947,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if let currentItem = self.tempVoicePlaylistCurrentItem {
|
||||
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
|
||||
guard let strongSelf = self else {
|
||||
@ -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
|
||||
strongSelf.additionalNavigationBarBackgroundHeight = value
|
||||
strongSelf.additionalNavigationBarHitTestSlop = hitTestSlop
|
||||
|
@ -144,6 +144,7 @@ struct ChatHistoryListViewTransition {
|
||||
var animateIn: Bool
|
||||
var reason: ChatHistoryViewTransitionReason
|
||||
var flashIndicators: Bool
|
||||
var animateFromPreviousFilter: Bool
|
||||
}
|
||||
|
||||
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 {
|
||||
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)
|
||||
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, animateFromPreviousFilter: animateFromPreviousFilter)
|
||||
}
|
||||
|
||||
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 {
|
||||
var fillsScreen = true
|
||||
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)
|
||||
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 {
|
||||
mappedTransition.options.remove(.AnimateInsertion)
|
||||
@ -1839,6 +1836,10 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
||||
mappedTransition.options.insert(.Synchronous)
|
||||
}
|
||||
|
||||
if resetScrolling {
|
||||
resetScrolling = false
|
||||
}
|
||||
|
||||
Queue.mainQueue().async {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
@ -3153,6 +3154,11 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
||||
self.currentAppliedDeleteAnimationCorrelationIds = appliedDeleteAnimationCorrelationIds
|
||||
|
||||
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
|
||||
if let strongSelf = self {
|
||||
@ -3496,6 +3502,17 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
||||
canSelect: canSelect && !isEmbeddedMode,
|
||||
resourceStatus: resourceStatus,
|
||||
messageActions: isEmbeddedMode ? ChatAvailableMessageActions(
|
||||
options: [],
|
||||
options: messageActions.options.intersection([.deleteLocally, .deleteGlobally]),
|
||||
banAuthor: nil,
|
||||
disableDelete: true,
|
||||
isCopyProtected: messageActions.isCopyProtected
|
||||
|
@ -93,10 +93,6 @@ func topMessageReactions(context: AccountContext, message: Message) -> Signal<[R
|
||||
loadTags = true
|
||||
}
|
||||
|
||||
if "".isEmpty {
|
||||
loadTags = false
|
||||
}
|
||||
|
||||
if loadTags {
|
||||
return tagMessageReactions(context: context)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user