diff --git a/TelegramUI/CallListViewTransition.swift b/TelegramUI/CallListViewTransition.swift index b982dc2d76..47638d86cf 100644 --- a/TelegramUI/CallListViewTransition.swift +++ b/TelegramUI/CallListViewTransition.swift @@ -12,7 +12,6 @@ struct CallListNodeView { enum CallListNodeViewTransitionReason { case initial case interactiveChanges - case holeChanges(filledHoleDirections: [MessageIndex: HoleFillDirection], removeHoleDirections: [MessageIndex: HoleFillDirection]) case reload case reloadAnimated } @@ -90,32 +89,6 @@ func preparedCallListNodeViewTransition(from fromView: CallListNodeView?, to toV let _ = options.insert(.LowLatency) let _ = options.insert(.Synchronous) let _ = options.insert(.AnimateCrossfade) - case let .holeChanges(filledHoleDirections, removeHoleDirections): - if let (_, removeDirection) = removeHoleDirections.first { - switch removeDirection { - case .LowerToUpper: - var holeIndex: MessageIndex? - for (index, _) in filledHoleDirections { - if holeIndex == nil || index < holeIndex! { - holeIndex = index - } - } - - if let holeIndex = holeIndex { - for i in 0 ..< toView.filteredEntries.count { - if toView.filteredEntries[i].index >= holeIndex { - let index = toView.filteredEntries.count - 1 - (i - 1) - stationaryItemRange = (index, Int.max) - break - } - } - } - case .UpperToLower: - break - case .AroundId, .AroundIndex: - break - } - } } for (index, entry, previousIndex) in indicesAndItems { diff --git a/TelegramUI/ChatController.swift b/TelegramUI/ChatController.swift index 4f45bbe577..3e9695fdac 100644 --- a/TelegramUI/ChatController.swift +++ b/TelegramUI/ChatController.swift @@ -29,7 +29,7 @@ public final class ChatControllerOverlayPresentationData { private enum ChatLocationInfoData { case peer(Promise) - case group(Promise) + //case group(Promise) } private enum ChatRecordingActivity { @@ -237,9 +237,9 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal case let .peer(peerId): locationBroadcastPanelSource = .peer(peerId) self.chatLocationInfoData = .peer(Promise()) - case .group: + /*case .group: locationBroadcastPanelSource = .none - self.chatLocationInfoData = .group(Promise()) + self.chatLocationInfoData = .group(Promise())*/ } self.presentationData = context.sharedContext.currentPresentationData.with { $0 } @@ -682,8 +682,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal if (peerId.namespace == Namespaces.Peer.CloudChannel || peerId.namespace == Namespaces.Peer.CloudGroup) { postAsReply = true } - case .group: - postAsReply = true + /*case .group: + postAsReply = true*/ } } @@ -1200,8 +1200,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal let avatarNode = ChatAvatarNavigationNode() avatarNode.chatController = self chatInfoButtonItem = UIBarButtonItem(customDisplayNode: avatarNode)! - case .group: - chatInfoButtonItem = UIBarButtonItem(customDisplayNode: ChatMultipleAvatarsNavigationNode())! + /*case .group: + chatInfoButtonItem = UIBarButtonItem(customDisplayNode: ChatMultipleAvatarsNavigationNode())!*/ } chatInfoButtonItem.target = self chatInfoButtonItem.action = #selector(self.rightNavigationButtonAction) @@ -1337,7 +1337,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal } })) } - case let .group(groupId): + /*case let .group(groupId): if case let .group(topPeersView) = self.chatLocationInfoData { let key: PostboxViewKey = .chatListTopPeers(groupId: groupId) topPeersView.set(context.account.postbox.combinedView(keys: [key]) @@ -1359,7 +1359,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal } } })) - } + }*/ } self.botCallbackAlertMessageDisposable = (self.botCallbackAlertMessage.get() @@ -2406,8 +2406,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal switch strongSelf.chatLocation { case .peer: strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex), forceInCurrentChat: true) - case .group: - strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex)) + /*case .group: + strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex))*/ } } } @@ -2899,9 +2899,9 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal strongSelf.chatDisplayNode.historyNode.scrollToNextMessage() } }, openGrouping: { [weak self] in - if let strongSelf = self, case let .group(groupId) = strongSelf.chatLocation { + /*if let strongSelf = self, case let .group(groupId) = strongSelf.chatLocation { (strongSelf.navigationController as? NavigationController)?.pushViewController(FeedGroupingController(context: strongSelf.context, groupId: groupId)) - } + }*/ }, toggleSilentPost: { [weak self] in if let strongSelf = self { var value: Bool = false @@ -3149,7 +3149,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: text, actions: actions), in: .window(.root)) } })) - case let .group(groupId): + /*case let .group(groupId): let unreadCountsKey: PostboxViewKey = .unreadCounts(items: [.group(groupId), .total(nil)]) self.chatUnreadCountDisposable = (self.context.account.postbox.combinedView(keys: [unreadCountsKey]) |> deliverOnMainQueue).start(next: { [weak self] views in if let strongSelf = self { @@ -3169,7 +3169,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal strongSelf.chatDisplayNode.navigateButtons.unreadCount = unreadCount } - }) + })*/ } self.interfaceInteraction = interfaceInteraction @@ -3834,10 +3834,10 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal } } })) - case .group: + /*case .group: if case let .group(groupId) = self.chatLocation { (self.navigationController as? NavigationController)?.pushViewController(ChatListController(context: self.context, groupId: groupId, controlsHistoryPreload: false)) - } + }*/ } case .search: self.interfaceInteraction?.beginMessageSearch(.everything, "") @@ -4705,8 +4705,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal switch self.chatLocation { case let .peer(peerId): derivedSearchState = ChatSearchState(query: search.query, location: .peer(peerId: peerId, fromId: nil, tags: nil), loadMoreState: loadMoreStateFromResultsState(search.resultsState)) - case let .group(groupId): - derivedSearchState = ChatSearchState(query: search.query, location: .group(groupId), loadMoreState: loadMoreStateFromResultsState(search.resultsState)) + /*case let .group(groupId): + derivedSearchState = ChatSearchState(query: search.query, location: .group(groupId), loadMoreState: loadMoreStateFromResultsState(search.resultsState))*/ } case .members: derivedSearchState = nil @@ -4714,8 +4714,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal switch self.chatLocation { case let .peer(peerId): derivedSearchState = ChatSearchState(query: search.query, location: .peer(peerId: peerId, fromId: peer.id, tags: nil), loadMoreState: loadMoreStateFromResultsState(search.resultsState)) - case .group: - derivedSearchState = nil + /*case .group: + derivedSearchState = nil*/ } } } @@ -4781,8 +4781,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal switch strongSelf.chatLocation { case .peer: strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex), forceInCurrentChat: true) - case .group: - strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex)) + /*case .group: + strongSelf.navigateToMessage(from: nil, to: .index(navigateIndex))*/ } } strongSelf.updateItemNodesSearchTextHighlightStates() @@ -5160,8 +5160,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal default: break } - case .group: - (self.navigationController as? NavigationController)?.pushViewController(ChatController(context: self.context, chatLocation: .peer(peerId), messageId: fromMessage?.id, botStart: nil)) + /*case .group: + (self.navigationController as? NavigationController)?.pushViewController(ChatController(context: self.context, chatLocation: .peer(peerId), messageId: fromMessage?.id, botStart: nil))*/ } } else { switch navigation { @@ -5649,8 +5649,8 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal switch chatLocation { case let .peer(peerId): let _ = data.swap(PreviewActionsData(notificationSettings: transaction.getPeerNotificationSettings(peerId), peer: transaction.getPeer(peerId))) - case .group: - let _ = data.swap(PreviewActionsData(notificationSettings: nil, peer: nil)) + /*case .group: + let _ = data.swap(PreviewActionsData(notificationSettings: nil, peer: nil))*/ } semaphore.signal() }).start() diff --git a/TelegramUI/ChatHistoryGridNode.swift b/TelegramUI/ChatHistoryGridNode.swift index 32d35e4cad..a73b4f2a25 100644 --- a/TelegramUI/ChatHistoryGridNode.swift +++ b/TelegramUI/ChatHistoryGridNode.swift @@ -300,8 +300,8 @@ public final class ChatHistoryGridNode: GridNode, ChatHistoryNode { reason = ChatHistoryViewTransitionReason.InteractiveChanges case .UpdateVisible: reason = ChatHistoryViewTransitionReason.Reload - case let .FillHole(insertions, deletions): - reason = ChatHistoryViewTransitionReason.HoleChanges(filledHoleDirections: insertions, removeHoleDirections: deletions) + case .FillHole: + reason = ChatHistoryViewTransitionReason.Reload } } diff --git a/TelegramUI/ChatHistoryListNode.swift b/TelegramUI/ChatHistoryListNode.swift index b03f930b11..5fdfe2b282 100644 --- a/TelegramUI/ChatHistoryListNode.swift +++ b/TelegramUI/ChatHistoryListNode.swift @@ -69,8 +69,8 @@ struct ChatHistoryView { enum ChatHistoryViewTransitionReason { case Initial(fadeIn: Bool) case InteractiveChanges - case HoleChanges(filledHoleDirections: [MessageIndex: HoleFillDirection], removeHoleDirections: [MessageIndex: HoleFillDirection]) case Reload + case HoleReload } struct ChatHistoryViewTransitionInsertEntry { @@ -576,8 +576,9 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { reason = ChatHistoryViewTransitionReason.InteractiveChanges case .UpdateVisible: reason = ChatHistoryViewTransitionReason.Reload - case let .FillHole(insertions, deletions): - reason = ChatHistoryViewTransitionReason.HoleChanges(filledHoleDirections: insertions, removeHoleDirections: deletions) + case .FillHole: + assertionFailure() + reason = ChatHistoryViewTransitionReason.Reload } } } @@ -614,10 +615,10 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { switch chatLocation { case .peer: let _ = applyMaxReadIndexInteractively(postbox: context.account.postbox, stateManager: context.account.stateManager, index: messageIndex).start() - case let .group(groupId): + /*case let .group(groupId): let _ = context.account.postbox.transaction({ transaction -> Void in transaction.applyGroupFeedInteractiveReadMaxIndex(groupId: groupId, index: messageIndex) - }).start() + }).start()*/ } } } diff --git a/TelegramUI/ChatHistoryViewForLocation.swift b/TelegramUI/ChatHistoryViewForLocation.swift index 8e1e4cd88f..278e6aa792 100644 --- a/TelegramUI/ChatHistoryViewForLocation.swift +++ b/TelegramUI/ChatHistoryViewForLocation.swift @@ -204,8 +204,8 @@ private func extractAdditionalData(view: MessageHistoryView, chatLocation: ChatL readStateData[peerId] = ChatHistoryCombinedInitialReadStateData(unreadCount: readState.count, totalState: totalUnreadState, notificationSettings: notificationSettings) } } - case .group: - break + /*case .group: + break*/ } default: break diff --git a/TelegramUI/ChatInfoTitlePanelNode.swift b/TelegramUI/ChatInfoTitlePanelNode.swift index c7e781a793..db3b35a905 100644 --- a/TelegramUI/ChatInfoTitlePanelNode.swift +++ b/TelegramUI/ChatInfoTitlePanelNode.swift @@ -155,8 +155,8 @@ final class ChatInfoTitlePanelNode: ChatTitleAccessoryPanelNode { } else { updatedButtons = [] } - case .group: - updatedButtons = groupButtons() + /*case .group: + updatedButtons = groupButtons()*/ } var buttonsUpdated = false diff --git a/TelegramUI/ChatInterfaceStateContextMenus.swift b/TelegramUI/ChatInterfaceStateContextMenus.swift index a09a7678ad..4f60c01e82 100644 --- a/TelegramUI/ChatInterfaceStateContextMenus.swift +++ b/TelegramUI/ChatInterfaceStateContextMenus.swift @@ -38,8 +38,8 @@ func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceS } else { canReply = true } - case .group: - break + /*case .group: + break*/ } return canReply } @@ -223,8 +223,8 @@ func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState: canPin = true } } - case .group: - break + /*case .group: + break*/ } } else { canReply = false diff --git a/TelegramUI/ChatInterfaceStateInputPanels.swift b/TelegramUI/ChatInterfaceStateInputPanels.swift index 1c23972046..c3fe8505b8 100644 --- a/TelegramUI/ChatInterfaceStateInputPanels.swift +++ b/TelegramUI/ChatInterfaceStateInputPanels.swift @@ -57,7 +57,7 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState var displayInputTextPanel = false - if case .group = chatPresentationInterfaceState.chatLocation { + /*if case .group = chatPresentationInterfaceState.chatLocation { if chatPresentationInterfaceState.interfaceState.editMessage != nil { displayInputTextPanel = true } else { @@ -72,7 +72,7 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState return panel } } - } + }*/ if let peer = chatPresentationInterfaceState.renderedPeer?.peer { if let secretChat = peer as? TelegramSecretChat { diff --git a/TelegramUI/ChatListController.swift b/TelegramUI/ChatListController.swift index 4a7e6f712c..398a941cdf 100644 --- a/TelegramUI/ChatListController.swift +++ b/TelegramUI/ChatListController.swift @@ -505,7 +505,7 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie } } - self.chatListDisplayNode.chatListNode.groupSelected = { [weak self] groupId in + /*self.chatListDisplayNode.chatListNode.groupSelected = { [weak self] groupId in if let strongSelf = self { if let navigationController = strongSelf.navigationController as? NavigationController { var scrollToEndIfExists = false @@ -522,7 +522,7 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie if let strongSelf = self { let _ = updatePeerGroupIdInteractively(postbox: strongSelf.context.account.postbox, peerId: peerId, groupId: group ? Namespaces.PeerGroup.feed : nil).start() } - } + }*/ self.chatListDisplayNode.requestOpenMessageFromSearch = { [weak self] peer, messageId in if let strongSelf = self { @@ -973,10 +973,10 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie } else { return nil } - case let .groupReference(groupId, _, _, _): + /*case let .groupReference(groupId, _, _, _): let chatListController = ChatListController(context: self.context, groupId: groupId, controlsHistoryPreload: false) chatListController.containerLayoutUpdated(ContainerViewLayout(size: contentSize, metrics: LayoutMetrics(), intrinsicInsets: UIEdgeInsets(), safeInsets: UIEdgeInsets(), statusBarHeight: nil, inputHeight: nil, standardInputHeight: 216.0, inputHeightIsInteractivellyChanging: false, inVoiceOver: false), transition: .immediate) - return (chatListController, sourceRect) + return (chatListController, sourceRect)*/ } } else { return nil diff --git a/TelegramUI/ChatListItem.swift b/TelegramUI/ChatListItem.swift index 0861680c85..61c448784e 100644 --- a/TelegramUI/ChatListItem.swift +++ b/TelegramUI/ChatListItem.swift @@ -8,14 +8,14 @@ import TelegramCore enum ChatListItemContent { case peer(message: Message?, peer: RenderedPeer, combinedReadState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, summaryInfo: ChatListMessageTagSummaryInfo, embeddedState: PeerChatListEmbeddedInterfaceState?, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool, ignoreUnreadBadge: Bool) - case groupReference(groupId: PeerGroupId, message: Message?, topPeers: [Peer], counters: GroupReferenceUnreadCounters) + //case groupReference(groupId: PeerGroupId, message: Message?, topPeers: [Peer], counters: GroupReferenceUnreadCounters) var chatLocation: ChatLocation { switch self { case let .peer(_, peer, _, _, _, _, _, _, _): return .peer(peer.peerId) - case let .groupReference(groupId, _, _, _): - return .group(groupId) + /*case let .groupReference(groupId, _, _, _): + return .group(groupId)*/ } } } @@ -107,8 +107,8 @@ class ChatListItem: ListViewItem { } else if let peer = peer.peers[peer.peerId] { self.interaction.peerSelected(peer) } - case let .groupReference(groupId, _, _, _): - self.interaction.groupSelected(groupId) + /*case let .groupReference(groupId, _, _, _): + self.interaction.groupSelected(groupId)*/ } } @@ -275,8 +275,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { return nil } switch item.content { - case .groupReference: - return nil + /*case .groupReference: + return nil*/ case let .peer(peer): guard let chatMainPeer = peer.peer.chatMainPeer else { return nil @@ -293,8 +293,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { return nil } switch item.content { - case .groupReference: - return nil + /*case .groupReference: + return nil*/ case let .peer(peer): if let message = peer.message { var result = "" @@ -402,8 +402,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { switch item.content { case let .peer(_, peerValue, _, _, _, _, _, _, _): peer = peerValue.chatMainPeer - case .groupReference: - break + /*case .groupReference: + break*/ } if let peer = peer { @@ -521,7 +521,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { inputActivities = inputActivitiesValue isPeerGroup = false isAd = isAdValue - case let .groupReference(_, messageValue, topPeersValue, counters): + /*case let .groupReference(_, messageValue, topPeersValue, counters): if let messageValue = messageValue { itemPeer = RenderedPeer(message: messageValue) } else { @@ -543,7 +543,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } else{ unreadCount = (0, false, false) } - isAd = false + isAd = false*/ } let theme = item.presentationData.theme.chatList @@ -612,11 +612,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } else { peerText = author.id == account.peerId ? item.presentationData.strings.DialogList_You : author.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) } - } else if case .groupReference = item.content { + }/* else if case .groupReference = item.content { if let messagePeer = itemPeer.chatMainPeer { peerText = messagePeer.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) } - } + }*/ if let peerText = peerText { authorAttributedString = NSAttributedString(string: peerText, font: textFont, textColor: theme.authorNameColor) @@ -632,8 +632,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } else if let displayTitle = peer?.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) { titleAttributedString = NSAttributedString(string: displayTitle, font: titleFont, textColor: item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat ? theme.secretTitleColor : theme.titleColor) } - case .groupReference: - titleAttributedString = NSAttributedString(string: "Feed", font: titleFont, textColor: theme.titleColor) + /*case .groupReference: + titleAttributedString = NSAttributedString(string: "Feed", font: titleFont, textColor: theme.titleColor)*/ } textAttributedString = attributedText @@ -807,7 +807,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { peerRevealOptions = [] peerLeftRevealOptions = [] } - case .groupReference: + /*case .groupReference: let isPinned = item.index.pinningIndex != nil if item.enableContextActions { @@ -815,7 +815,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } else { peerRevealOptions = [] } - peerLeftRevealOptions = [] + peerLeftRevealOptions = []*/ } return (layout, { [weak self] synchronousLoads, animated in @@ -1267,8 +1267,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { switch item.content { case .peer: itemId = .peer(item.index.messageIndex.id.peerId) - case let .groupReference(groupId, _, _, _): - itemId = .group(groupId) + /*case let .groupReference(groupId, _, _, _): + itemId = .group(groupId)*/ } item.interaction.setItemPinned(itemId, true) case RevealOptionKey.unpin.rawValue: @@ -1276,8 +1276,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { switch item.content { case .peer: itemId = .peer(item.index.messageIndex.id.peerId) - case let .groupReference(groupId, _, _, _): - itemId = .group(groupId) + /*case let .groupReference(groupId, _, _, _): + itemId = .group(groupId)*/ } item.interaction.setItemPinned(itemId, false) case RevealOptionKey.mute.rawValue: diff --git a/TelegramUI/ChatListNode.swift b/TelegramUI/ChatListNode.swift index 498ee571b6..02b01cc52b 100644 --- a/TelegramUI/ChatListNode.swift +++ b/TelegramUI/ChatListNode.swift @@ -204,8 +204,8 @@ private func mappedInsertEntries(account: Account, nodeInteraction: ChatListNode } case let .HoleEntry(_, theme): return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint) - case let .GroupReferenceEntry(index, presentationData, groupId, message, topPeers, counters, editing): - return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, message: message, topPeers: topPeers, counters: counters), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, interaction: nodeInteraction), directionHint: entry.directionHint) + /*case let .GroupReferenceEntry(index, presentationData, groupId, message, topPeers, counters, editing): + return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, message: message, topPeers: topPeers, counters: counters), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, interaction: nodeInteraction), directionHint: entry.directionHint)*/ } } } @@ -241,8 +241,8 @@ private func mappedUpdateEntries(account: Account, nodeInteraction: ChatListNode } case let .HoleEntry(_, theme): return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint) - case let .GroupReferenceEntry(index, presentationData, groupId, message, topPeers, counters, editing): - return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, message: message, topPeers: topPeers, counters: counters), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, interaction: nodeInteraction), directionHint: entry.directionHint) + /*case let .GroupReferenceEntry(index, presentationData, groupId, message, topPeers, counters, editing): + return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, message: message, topPeers: topPeers, counters: counters), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, interaction: nodeInteraction), directionHint: entry.directionHint)*/ } } } @@ -817,8 +817,8 @@ final class ChatListNode: ListView { } else { referenceId = .peer(index.messageIndex.id.peerId) } - case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): - referenceId = .group(groupId) + /*case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): + referenceId = .group(groupId)*/ default: break } @@ -831,8 +831,8 @@ final class ChatListNode: ListView { switch fromEntry { case let .PeerEntry(index, _, _, _, _, _, _, _, _, _, _, _, _): itemId = .peer(index.messageIndex.id.peerId) - case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): - itemId = .group(groupId) + /*case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): + itemId = .group(groupId)*/ default: break } diff --git a/TelegramUI/ChatListNodeEntries.swift b/TelegramUI/ChatListNodeEntries.swift index 6fc5ee8ba9..77176d8eff 100644 --- a/TelegramUI/ChatListNodeEntries.swift +++ b/TelegramUI/ChatListNodeEntries.swift @@ -45,7 +45,7 @@ enum ChatListNodeEntryId: Hashable { enum ChatListNodeEntry: Comparable, Identifiable { case PeerEntry(index: ChatListIndex, presentationData: ChatListPresentationData, message: Message?, readState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, embeddedInterfaceState: PeerChatListEmbeddedInterfaceState?, peer: RenderedPeer, summaryInfo: ChatListMessageTagSummaryInfo, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool) case HoleEntry(ChatListHole, theme: PresentationTheme) - case GroupReferenceEntry(index: ChatListIndex, presentationData: ChatListPresentationData, groupId: PeerGroupId, message: Message?, topPeers: [Peer], counters: GroupReferenceUnreadCounters, editing: Bool) + //case GroupReferenceEntry(index: ChatListIndex, presentationData: ChatListPresentationData, groupId: PeerGroupId, message: Message?, topPeers: [Peer], counters: GroupReferenceUnreadCounters, editing: Bool) var index: ChatListIndex { switch self { @@ -53,8 +53,8 @@ enum ChatListNodeEntry: Comparable, Identifiable { return index case let .HoleEntry(hole, _): return ChatListIndex(pinningIndex: nil, messageIndex: hole.index) - case let .GroupReferenceEntry(index, _, _, _, _, _, _): - return index + /*case let .GroupReferenceEntry(index, _, _, _, _, _, _): + return index*/ } } @@ -64,8 +64,8 @@ enum ChatListNodeEntry: Comparable, Identifiable { return .PeerId(index.messageIndex.id.peerId.toInt64()) case let .HoleEntry(hole, _): return .Hole(Int64(hole.index.id.id)) - case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): - return .GroupId(groupId) + /*case let .GroupReferenceEntry(_, _, groupId, _, _, _, _): + return .GroupId(groupId)*/ } } @@ -149,7 +149,7 @@ enum ChatListNodeEntry: Comparable, Identifiable { default: return false } - case let .GroupReferenceEntry(lhsIndex, lhsPresentationData, lhsGroupId, lhsMessage, lhsTopPeers, lhsCounters, lhsEditing): + /*case let .GroupReferenceEntry(lhsIndex, lhsPresentationData, lhsGroupId, lhsMessage, lhsTopPeers, lhsCounters, lhsEditing): if case let .GroupReferenceEntry(rhsIndex, rhsPresentationData, rhsGroupId, rhsMessage, rhsTopPeers, rhsCounters, rhsEditing) = rhs { if lhsIndex != rhsIndex { return false @@ -184,7 +184,7 @@ enum ChatListNodeEntry: Comparable, Identifiable { return true } else { return false - } + }*/ } } } @@ -222,10 +222,10 @@ func chatListNodeEntriesForView(_ view: ChatListView, state: ChatListNodeState, result.append(.PeerEntry(index: offsetPinnedIndex(index, offset: pinnedIndexOffset), presentationData: state.presentationData, message: updatedMessage, readState: updatedCombinedReadState, notificationSettings: notificationSettings, embeddedInterfaceState: embeddedState, peer: peer, summaryInfo: summaryInfo, editing: state.editing, hasActiveRevealControls: index.messageIndex.id.peerId == state.peerIdWithRevealedOptions, selected: state.selectedPeerIds.contains(index.messageIndex.id.peerId), inputActivities: state.peerInputActivities?.activities[index.messageIndex.id.peerId], isAd: false)) case let .HoleEntry(hole): result.append(.HoleEntry(hole, theme: state.presentationData.theme)) - case let .GroupReferenceEntry(groupId, index, message, topPeers, counters): + /*case let .GroupReferenceEntry(groupId, index, message, topPeers, counters): if case .chatList = mode { result.append(.GroupReferenceEntry(index: index, presentationData: state.presentationData, groupId: groupId, message: message, topPeers: topPeers, counters: counters, editing: state.editing)) - } + }*/ } } if view.laterIndex == nil { diff --git a/TelegramUI/ChatListSearchContainerNode.swift b/TelegramUI/ChatListSearchContainerNode.swift index 88ca2223aa..1a213ddddc 100644 --- a/TelegramUI/ChatListSearchContainerNode.swift +++ b/TelegramUI/ChatListSearchContainerNode.swift @@ -1177,8 +1177,8 @@ final class ChatListSearchContainerNode: SearchDisplayControllerContentNode { switch item.content { case let .peer(message, peer, _, _, _, _, _, _, _): return (selectedItemNode.view, bounds, message?.id ?? peer.peerId) - case let .groupReference(groupId, _, _, _): - return (selectedItemNode.view, bounds, groupId) + /*case let .groupReference(groupId, _, _, _): + return (selectedItemNode.view, bounds, groupId)*/ } } return nil diff --git a/TelegramUI/ChatListViewTransition.swift b/TelegramUI/ChatListViewTransition.swift index c8da47fdaa..032f894e14 100644 --- a/TelegramUI/ChatListViewTransition.swift +++ b/TelegramUI/ChatListViewTransition.swift @@ -13,7 +13,7 @@ struct ChatListNodeView { enum ChatListNodeViewTransitionReason { case initial case interactiveChanges - case holeChanges(filledHoleDirections: [MessageIndex: HoleFillDirection], removeHoleDirections: [MessageIndex: HoleFillDirection]) + case holeChanges case reload } @@ -105,32 +105,8 @@ func preparedChatListNodeViewTransition(from fromView: ChatListNodeView?, to toV } case .reload: break - case let .holeChanges(filledHoleDirections, removeHoleDirections): - if let (_, removeDirection) = removeHoleDirections.first { - switch removeDirection { - case .LowerToUpper: - var holeIndex: ChatListIndex? - for (index, _) in filledHoleDirections { - if holeIndex == nil || index < holeIndex!.messageIndex { - holeIndex = ChatListIndex(pinningIndex: nil, messageIndex: index) - } - } - - if let holeIndex = holeIndex { - for i in 0 ..< toView.filteredEntries.count { - if toView.filteredEntries[i].index >= holeIndex { - let index = toView.filteredEntries.count - 1 - (i - 1) - stationaryItemRange = (index, Int.max) - break - } - } - } - case .UpperToLower: - break - case .AroundId, .AroundIndex: - break - } - } + case .holeChanges: + break } for (index, entry, previousIndex) in indicesAndItems { diff --git a/TelegramUI/ChatMessageAnimatedStickerItemNode.swift b/TelegramUI/ChatMessageAnimatedStickerItemNode.swift index d2df99cff3..10de1d3b72 100644 --- a/TelegramUI/ChatMessageAnimatedStickerItemNode.swift +++ b/TelegramUI/ChatMessageAnimatedStickerItemNode.swift @@ -189,23 +189,23 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { var hasAvatar = false switch item.chatLocation { - case let .peer(peerId): - if peerId != item.context.account.peerId { - if peerId.isGroupOrChannel && item.message.author != nil { - var isBroadcastChannel = false - if let peer = item.message.peers[item.message.id.peerId] as? TelegramChannel, case .broadcast = peer.info { - isBroadcastChannel = true - } - - if !isBroadcastChannel { - hasAvatar = true + case let .peer(peerId): + if peerId != item.context.account.peerId { + if peerId.isGroupOrChannel && item.message.author != nil { + var isBroadcastChannel = false + if let peer = item.message.peers[item.message.id.peerId] as? TelegramChannel, case .broadcast = peer.info { + isBroadcastChannel = true + } + + if !isBroadcastChannel { + hasAvatar = true + } } + } else if incoming { + hasAvatar = true } - } else if incoming { - hasAvatar = true - } - case .group: - hasAvatar = true + /*case .group: + hasAvatar = true*/ } if hasAvatar { diff --git a/TelegramUI/ChatMessageBubbleItemNode.swift b/TelegramUI/ChatMessageBubbleItemNode.swift index 517f0b3c91..0f7b3c0e21 100644 --- a/TelegramUI/ChatMessageBubbleItemNode.swift +++ b/TelegramUI/ChatMessageBubbleItemNode.swift @@ -360,10 +360,10 @@ class ChatMessageBubbleItemNode: ChatMessageItemView { } else if incoming { hasAvatar = true } - case .group: + /*case .group: allowFullWidth = true hasAvatar = true - displayAuthorInfo = true + displayAuthorInfo = true*/ } if let forwardInfo = item.content.firstMessage.forwardInfo, forwardInfo.source == nil, forwardInfo.author.id.namespace == Namespaces.Peer.CloudUser { diff --git a/TelegramUI/ChatMessageInstantVideoItemNode.swift b/TelegramUI/ChatMessageInstantVideoItemNode.swift index 575942e77a..23428507be 100644 --- a/TelegramUI/ChatMessageInstantVideoItemNode.swift +++ b/TelegramUI/ChatMessageInstantVideoItemNode.swift @@ -119,8 +119,8 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView { } else if incoming { hasAvatar = true } - case .group: - hasAvatar = true + /*case .group: + hasAvatar = true*/ } if hasAvatar { diff --git a/TelegramUI/ChatMessageItem.swift b/TelegramUI/ChatMessageItem.swift index e7e07a9f76..81c5b816ce 100644 --- a/TelegramUI/ChatMessageItem.swift +++ b/TelegramUI/ChatMessageItem.swift @@ -276,9 +276,9 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible { effectiveAuthor = content.firstMessage.author displayAuthorInfo = incoming && peerId.isGroupOrChannel && effectiveAuthor != nil } - case .group: + /*case .group: effectiveAuthor = content.firstMessage.author - displayAuthorInfo = incoming && effectiveAuthor != nil + displayAuthorInfo = incoming && effectiveAuthor != nil*/ } self.effectiveAuthorId = effectiveAuthor?.id diff --git a/TelegramUI/ChatMessageStickerItemNode.swift b/TelegramUI/ChatMessageStickerItemNode.swift index dde843457d..d54f15bbfd 100644 --- a/TelegramUI/ChatMessageStickerItemNode.swift +++ b/TelegramUI/ChatMessageStickerItemNode.swift @@ -144,8 +144,8 @@ class ChatMessageStickerItemNode: ChatMessageItemView { } else if incoming { hasAvatar = true } - case .group: - hasAvatar = true + /*case .group: + hasAvatar = true*/ } if hasAvatar { diff --git a/TelegramUI/ChatRecentActionsHistoryTransition.swift b/TelegramUI/ChatRecentActionsHistoryTransition.swift index f0e8d2a8b3..b98dee12d7 100644 --- a/TelegramUI/ChatRecentActionsHistoryTransition.swift +++ b/TelegramUI/ChatRecentActionsHistoryTransition.swift @@ -66,7 +66,7 @@ private func filterOriginalMessageFlags(_ message: Message) -> Message { private func filterMessageChannelPeer(_ peer: Peer) -> Peer { if let peer = peer as? TelegramChannel { - return TelegramChannel(id: peer.id, accessHash: peer.accessHash, title: peer.title, username: peer.username, photo: peer.photo, creationDate: peer.creationDate, version: peer.version, participationStatus: peer.participationStatus, info: .group(TelegramChannelGroupInfo(flags: [])), flags: peer.flags, restrictionInfo: peer.restrictionInfo, adminRights: peer.adminRights, bannedRights: peer.bannedRights, defaultBannedRights: peer.defaultBannedRights, peerGroupId: peer.peerGroupId) + return TelegramChannel(id: peer.id, accessHash: peer.accessHash, title: peer.title, username: peer.username, photo: peer.photo, creationDate: peer.creationDate, version: peer.version, participationStatus: peer.participationStatus, info: .group(TelegramChannelGroupInfo(flags: [])), flags: peer.flags, restrictionInfo: peer.restrictionInfo, adminRights: peer.adminRights, bannedRights: peer.bannedRights, defaultBannedRights: peer.defaultBannedRights) } return peer } diff --git a/TelegramUI/ChatSearchNavigationContentNode.swift b/TelegramUI/ChatSearchNavigationContentNode.swift index fe29713fb3..bd8e4239b6 100644 --- a/TelegramUI/ChatSearchNavigationContentNode.swift +++ b/TelegramUI/ChatSearchNavigationContentNode.swift @@ -25,8 +25,8 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode { switch chatLocation { case .peer: placeholderText = strings.Conversation_SearchPlaceholder - case .group: - placeholderText = "Search this feed" + /*case .group: + placeholderText = "Search this feed"*/ } self.searchBar.placeholderString = NSAttributedString(string: placeholderText, font: searchBarFont, textColor: theme.rootController.activeNavigationSearchBar.inputPlaceholderTextColor) @@ -77,8 +77,8 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode { switch self.chatLocation { case .peer: placeholderText = self.strings.Conversation_SearchPlaceholder - case .group: - placeholderText = "Search this feed" + /*case .group: + placeholderText = "Search this feed"*/ } self.searchBar.placeholderString = NSAttributedString(string: placeholderText, font: searchBarFont, textColor: theme.rootController.activeNavigationSearchBar.inputPlaceholderTextColor) case .members: diff --git a/TelegramUI/FeedGroupingController.swift b/TelegramUI/FeedGroupingController.swift index a8ccf0f823..e171a7de09 100644 --- a/TelegramUI/FeedGroupingController.swift +++ b/TelegramUI/FeedGroupingController.swift @@ -4,7 +4,7 @@ import TelegramCore import Postbox import SwiftSignalKit -final class FeedGroupingController: ViewController { +/*final class FeedGroupingController: ViewController { private var controllerNode: FeedGroupingControllerNode { return self.displayNode as! FeedGroupingControllerNode } @@ -51,3 +51,4 @@ final class FeedGroupingController: ViewController { } } +*/ diff --git a/TelegramUI/FeedGroupingControllerNode.swift b/TelegramUI/FeedGroupingControllerNode.swift index b33e793ca3..8797e0f971 100644 --- a/TelegramUI/FeedGroupingControllerNode.swift +++ b/TelegramUI/FeedGroupingControllerNode.swift @@ -6,7 +6,7 @@ import Display import SafariServices -private enum FeedGroupingControllerTransitionType { +/*private enum FeedGroupingControllerTransitionType { case initial case initialLoad case generic @@ -483,3 +483,4 @@ final class FeedGroupingControllerNode: ViewControllerTracingNode { } } +*/ diff --git a/TelegramUI/PreparedChatHistoryViewTransition.swift b/TelegramUI/PreparedChatHistoryViewTransition.swift index 686d37ba03..6a0724162d 100644 --- a/TelegramUI/PreparedChatHistoryViewTransition.swift +++ b/TelegramUI/PreparedChatHistoryViewTransition.swift @@ -55,8 +55,9 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie } case .Reload: stationaryItemRange = (0, Int.max) - case let .HoleChanges(filledHoleDirections, removeHoleDirections): - if let (_, removeDirection) = removeHoleDirections.first { + case .HoleReload: + stationaryItemRange = (0, Int.max) + /*if let (_, removeDirection) = removeHoleDirections.first { switch removeDirection { case .LowerToUpper: var holeIndex: MessageIndex? @@ -80,7 +81,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie case .AroundId, .AroundIndex: break } - } + }*/ } for (index, entry, previousIndex) in mergeResult.indicesAndItems {