mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Updated archive folder appearance
This commit is contained in:
parent
4b45163e7c
commit
3ff945bf63
@ -7099,7 +7099,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramUI;
|
PRODUCT_BUNDLE_IDENTIFIER = org.telegram.TelegramUI;
|
||||||
PRODUCT_NAME = TelegramUI;
|
PRODUCT_NAME = TelegramUI;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = NO;
|
||||||
SWIFT_COMPILATION_MODE = wholemodule;
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
SWIFT_INSTALL_OBJC_HEADER = YES;
|
SWIFT_INSTALL_OBJC_HEADER = YES;
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.0;
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1010"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "D0EC6CA41EB9F4CC00EBF1C3"
|
||||||
|
BuildableName = "TelegramUI.framework"
|
||||||
|
BlueprintName = "TelegramUI"
|
||||||
|
ReferencedContainer = "container:TelegramUI.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "DebugHockeyapp"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "DebugHockeyapp"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "D0EC6CA41EB9F4CC00EBF1C3"
|
||||||
|
BuildableName = "TelegramUI.framework"
|
||||||
|
BlueprintName = "TelegramUI"
|
||||||
|
ReferencedContainer = "container:TelegramUI.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "ReleaseHockeyapp"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "D0EC6CA41EB9F4CC00EBF1C3"
|
||||||
|
BuildableName = "TelegramUI.framework"
|
||||||
|
BlueprintName = "TelegramUI"
|
||||||
|
ReferencedContainer = "container:TelegramUI.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "DebugHockeyapp">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "ReleaseHockeyapp"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
@ -1237,7 +1237,7 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie
|
|||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case let .groupReference(groupId, _, _, _, _):
|
case let .groupReference(groupId, _, _, _):
|
||||||
let chatListController = ChatListController(context: self.context, groupId: groupId, controlsHistoryPreload: false)
|
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)
|
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)
|
||||||
|
@ -4,6 +4,7 @@ import AsyncDisplayKit
|
|||||||
import Display
|
import Display
|
||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
import SwiftSignalKit
|
||||||
|
|
||||||
private final class ChatListControllerNodeView: UITracingLayerView, PreviewingHostView {
|
private final class ChatListControllerNodeView: UITracingLayerView, PreviewingHostView {
|
||||||
var previewingDelegate: PreviewingHostViewDelegate? {
|
var previewingDelegate: PreviewingHostViewDelegate? {
|
||||||
@ -17,6 +18,22 @@ private final class ChatListControllerNodeView: UITracingLayerView, PreviewingHo
|
|||||||
weak var controller: ChatListController?
|
weak var controller: ChatListController?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct TestItem: Comparable, Identifiable {
|
||||||
|
var value: Int
|
||||||
|
var version: Int
|
||||||
|
|
||||||
|
var stableId: Int {
|
||||||
|
return self.value
|
||||||
|
}
|
||||||
|
|
||||||
|
static func <(lhs: TestItem, rhs: TestItem) -> Bool {
|
||||||
|
if lhs.version != rhs.version {
|
||||||
|
return lhs.version < rhs.version
|
||||||
|
}
|
||||||
|
return lhs.value < rhs.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final class ChatListControllerNode: ASDisplayNode {
|
final class ChatListControllerNode: ASDisplayNode {
|
||||||
private let context: AccountContext
|
private let context: AccountContext
|
||||||
private let groupId: PeerGroupId
|
private let groupId: PeerGroupId
|
||||||
@ -43,6 +60,8 @@ final class ChatListControllerNode: ASDisplayNode {
|
|||||||
var requestAddContact: ((String) -> Void)?
|
var requestAddContact: ((String) -> Void)?
|
||||||
var dismissSelf: (() -> Void)?
|
var dismissSelf: (() -> Void)?
|
||||||
|
|
||||||
|
let debugListView = ListView()
|
||||||
|
|
||||||
init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, presentationData: PresentationData, controller: ChatListController) {
|
init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, presentationData: PresentationData, controller: ChatListController) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.groupId = groupId
|
self.groupId = groupId
|
||||||
@ -106,6 +125,8 @@ final class ChatListControllerNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.addSubnode(self.debugListView)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func didLoad() {
|
override func didLoad() {
|
||||||
|
@ -8,7 +8,7 @@ import TelegramCore
|
|||||||
|
|
||||||
enum ChatListItemContent {
|
enum ChatListItemContent {
|
||||||
case peer(message: Message?, peer: RenderedPeer, combinedReadState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, presence: PeerPresence?, summaryInfo: ChatListMessageTagSummaryInfo, embeddedState: PeerChatListEmbeddedInterfaceState?, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool, ignoreUnreadBadge: Bool)
|
case peer(message: Message?, peer: RenderedPeer, combinedReadState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, presence: PeerPresence?, summaryInfo: ChatListMessageTagSummaryInfo, embeddedState: PeerChatListEmbeddedInterfaceState?, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool, ignoreUnreadBadge: Bool)
|
||||||
case groupReference(groupId: PeerGroupId, peer: RenderedPeer, message: Message?, unreadState: PeerGroupUnreadCountersCombinedSummary, hiddenByDefault: Bool)
|
case groupReference(groupId: PeerGroupId, peers: [RenderedPeer], unreadState: PeerGroupUnreadCountersCombinedSummary, hiddenByDefault: Bool)
|
||||||
|
|
||||||
var chatLocation: ChatLocation? {
|
var chatLocation: ChatLocation? {
|
||||||
switch self {
|
switch self {
|
||||||
@ -113,7 +113,7 @@ class ChatListItem: ListViewItem {
|
|||||||
} else if let peer = peer.peers[peer.peerId] {
|
} else if let peer = peer.peers[peer.peerId] {
|
||||||
self.interaction.peerSelected(peer)
|
self.interaction.peerSelected(peer)
|
||||||
}
|
}
|
||||||
case let .groupReference(groupId, _, _, _, _):
|
case let .groupReference(groupId, _, _, _):
|
||||||
self.interaction.groupSelected(groupId)
|
self.interaction.groupSelected(groupId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -566,7 +566,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
return { item, params, first, last, firstWithHeader, nextIsPinned in
|
return { item, params, first, last, firstWithHeader, nextIsPinned in
|
||||||
let account = item.account
|
let account = item.account
|
||||||
var message: Message?
|
var message: Message?
|
||||||
let itemPeer: RenderedPeer
|
enum ContentPeer {
|
||||||
|
case chat(RenderedPeer)
|
||||||
|
case group([RenderedPeer])
|
||||||
|
}
|
||||||
|
let contentPeer: ContentPeer
|
||||||
let combinedReadState: CombinedPeerReadState?
|
let combinedReadState: CombinedPeerReadState?
|
||||||
let unreadCount: (count: Int32, unread: Bool, muted: Bool, mutedCount: Int32?)
|
let unreadCount: (count: Int32, unread: Bool, muted: Bool, mutedCount: Int32?)
|
||||||
let notificationSettings: PeerNotificationSettings?
|
let notificationSettings: PeerNotificationSettings?
|
||||||
@ -582,7 +586,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
switch item.content {
|
switch item.content {
|
||||||
case let .peer(messageValue, peerValue, combinedReadStateValue, notificationSettingsValue, peerPresenceValue, summaryInfoValue, embeddedStateValue, inputActivitiesValue, isAdValue, ignoreUnreadBadge):
|
case let .peer(messageValue, peerValue, combinedReadStateValue, notificationSettingsValue, peerPresenceValue, summaryInfoValue, embeddedStateValue, inputActivitiesValue, isAdValue, ignoreUnreadBadge):
|
||||||
message = messageValue
|
message = messageValue
|
||||||
itemPeer = peerValue
|
contentPeer = .chat(peerValue)
|
||||||
combinedReadState = combinedReadStateValue
|
combinedReadState = combinedReadStateValue
|
||||||
if let combinedReadState = combinedReadState, !isAdValue && !ignoreUnreadBadge {
|
if let combinedReadState = combinedReadState, !isAdValue && !ignoreUnreadBadge {
|
||||||
unreadCount = (combinedReadState.count, combinedReadState.isUnread, notificationSettingsValue?.isRemovedFromTotalUnreadCount ?? false, nil)
|
unreadCount = (combinedReadState.count, combinedReadState.isUnread, notificationSettingsValue?.isRemovedFromTotalUnreadCount ?? false, nil)
|
||||||
@ -600,9 +604,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
inputActivities = inputActivitiesValue
|
inputActivities = inputActivitiesValue
|
||||||
isPeerGroup = false
|
isPeerGroup = false
|
||||||
isAd = isAdValue
|
isAd = isAdValue
|
||||||
case let .groupReference(_, peer, messageValue, unreadState, hiddenByDefault):
|
case let .groupReference(_, peers, unreadState, hiddenByDefault):
|
||||||
itemPeer = peer
|
contentPeer = .group(peers)
|
||||||
message = messageValue
|
message = nil
|
||||||
combinedReadState = nil
|
combinedReadState = nil
|
||||||
notificationSettings = nil
|
notificationSettings = nil
|
||||||
embeddedState = nil
|
embeddedState = nil
|
||||||
@ -670,10 +674,22 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
|
|
||||||
let leftInset: CGFloat = params.leftInset + 78.0
|
let leftInset: CGFloat = params.leftInset + 78.0
|
||||||
|
|
||||||
|
enum ContentData {
|
||||||
|
case chat(itemPeer: RenderedPeer, peer: Peer?, hideAuthor: Bool, messageText: String)
|
||||||
|
case group(peers: [RenderedPeer])
|
||||||
|
}
|
||||||
|
|
||||||
|
let contentData: ContentData
|
||||||
|
|
||||||
|
var hideAuthor = false
|
||||||
|
switch contentPeer {
|
||||||
|
case let .chat(itemPeer):
|
||||||
let (peer, initialHideAuthor, messageText) = chatListItemStrings(strings: item.presentationData.strings, nameDisplayOrder: item.presentationData.nameDisplayOrder, message: message, chatPeer: itemPeer, accountPeerId: item.account.peerId)
|
let (peer, initialHideAuthor, messageText) = chatListItemStrings(strings: item.presentationData.strings, nameDisplayOrder: item.presentationData.nameDisplayOrder, message: message, chatPeer: itemPeer, accountPeerId: item.account.peerId)
|
||||||
var hideAuthor = initialHideAuthor
|
contentData = .chat(itemPeer: itemPeer, peer: peer, hideAuthor: hideAuthor, messageText: messageText)
|
||||||
if isPeerGroup {
|
hideAuthor = initialHideAuthor
|
||||||
hideAuthor = false
|
case let .group(groupPeers):
|
||||||
|
contentData = .group(peers: groupPeers)
|
||||||
|
hideAuthor = true
|
||||||
}
|
}
|
||||||
|
|
||||||
let attributedText: NSAttributedString
|
let attributedText: NSAttributedString
|
||||||
@ -690,6 +706,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch contentData {
|
||||||
|
case let .chat(itemPeer, peer, _, messageText):
|
||||||
if inlineAuthorPrefix == nil, let embeddedState = embeddedState as? ChatEmbeddedInterfaceState {
|
if inlineAuthorPrefix == nil, let embeddedState = embeddedState as? ChatEmbeddedInterfaceState {
|
||||||
hasDraft = true
|
hasDraft = true
|
||||||
authorAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_Draft, font: textFont, textColor: theme.messageDraftTextColor)
|
authorAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_Draft, font: textFont, textColor: theme.messageDraftTextColor)
|
||||||
@ -734,15 +752,30 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
authorAttributedString = NSAttributedString(string: peerText, font: textFont, textColor: theme.authorNameColor)
|
authorAttributedString = NSAttributedString(string: peerText, font: textFont, textColor: theme.authorNameColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case let .group(peers):
|
||||||
|
var textString = ""
|
||||||
|
for peer in peers {
|
||||||
|
if let peer = peer.chatMainPeer {
|
||||||
|
let peerTitle = peer.compactDisplayTitle
|
||||||
|
if !peerTitle.isEmpty {
|
||||||
|
if !textString.isEmpty {
|
||||||
|
textString.append(", ")
|
||||||
|
}
|
||||||
|
textString.append(peerTitle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
attributedText = NSAttributedString(string: textString, font: textFont, textColor: theme.messageTextColor)
|
||||||
|
}
|
||||||
|
|
||||||
switch item.content {
|
switch contentData {
|
||||||
case .peer:
|
case let .chat(_, peer, _, _):
|
||||||
if peer?.id == item.account.peerId {
|
if peer?.id == item.account.peerId {
|
||||||
titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: titleFont, textColor: theme.titleColor)
|
titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: titleFont, textColor: theme.titleColor)
|
||||||
} else if let displayTitle = peer?.displayTitle(strings: item.presentationData.strings, displayOrder: item.presentationData.nameDisplayOrder) {
|
} 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)
|
titleAttributedString = NSAttributedString(string: displayTitle, font: titleFont, textColor: item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat ? theme.secretTitleColor : theme.titleColor)
|
||||||
}
|
}
|
||||||
case .groupReference:
|
case .group:
|
||||||
titleAttributedString = NSAttributedString(string: item.presentationData.strings.ChatList_ArchivedChatsTitle, font: titleFont, textColor: theme.titleColor)
|
titleAttributedString = NSAttributedString(string: item.presentationData.strings.ChatList_ArchivedChatsTitle, font: titleFont, textColor: theme.titleColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -755,7 +788,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
|
let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
|
||||||
let dateText = stringForRelativeTimestamp(strings: item.presentationData.strings, relativeTimestamp: item.index.messageIndex.timestamp, relativeTo: timestamp, dateTimeFormat: item.presentationData.dateTimeFormat)
|
let dateText = stringForRelativeTimestamp(strings: item.presentationData.strings, relativeTimestamp: item.index.messageIndex.timestamp, relativeTo: timestamp, dateTimeFormat: item.presentationData.dateTimeFormat)
|
||||||
|
|
||||||
if isAd {
|
if isPeerGroup {
|
||||||
|
dateAttributedString = NSAttributedString(string: "", font: dateFont, textColor: theme.dateTextColor)
|
||||||
|
} else if isAd {
|
||||||
dateAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_AdLabel, font: dateFont, textColor: theme.dateTextColor)
|
dateAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_AdLabel, font: dateFont, textColor: theme.dateTextColor)
|
||||||
} else {
|
} else {
|
||||||
dateAttributedString = NSAttributedString(string: dateText, font: dateFont, textColor: theme.dateTextColor)
|
dateAttributedString = NSAttributedString(string: dateText, font: dateFont, textColor: theme.dateTextColor)
|
||||||
@ -845,7 +880,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
var isVerified = false
|
var isVerified = false
|
||||||
let isSecret = !isPeerGroup && item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat
|
let isSecret = !isPeerGroup && item.index.messageIndex.id.peerId.namespace == Namespaces.Peer.SecretChat
|
||||||
|
|
||||||
if case .peer = item.content {
|
if case let .chat(itemPeer) = contentPeer {
|
||||||
if let peer = itemPeer.chatMainPeer {
|
if let peer = itemPeer.chatMainPeer {
|
||||||
if let peer = peer as? TelegramUser {
|
if let peer = peer as? TelegramUser {
|
||||||
isVerified = peer.flags.contains(.isVerified)
|
isVerified = peer.flags.contains(.isVerified)
|
||||||
@ -937,7 +972,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
|
|
||||||
if item.enableContextActions && !isAd {
|
if item.enableContextActions && !isAd {
|
||||||
peerRevealOptions = revealOptions(strings: item.presentationData.strings, theme: item.presentationData.theme, isPinned: isPinned, isMuted: item.account.peerId != item.index.messageIndex.id.peerId ? (currentMutedIconImage != nil) : nil, groupId: item.peerGroupId, peerId: renderedPeer.peerId, accountPeerId: item.account.peerId, canDelete: true, isEditing: item.editing)
|
peerRevealOptions = revealOptions(strings: item.presentationData.strings, theme: item.presentationData.theme, isPinned: isPinned, isMuted: item.account.peerId != item.index.messageIndex.id.peerId ? (currentMutedIconImage != nil) : nil, groupId: item.peerGroupId, peerId: renderedPeer.peerId, accountPeerId: item.account.peerId, canDelete: true, isEditing: item.editing)
|
||||||
|
if case let .chat(itemPeer) = contentPeer {
|
||||||
peerLeftRevealOptions = leftRevealOptions(strings: item.presentationData.strings, theme: item.presentationData.theme, isUnread: unreadCount.unread, isEditing: item.editing, isPinned: isPinned, isSavedMessages: itemPeer.peerId == item.account.peerId, groupId: item.peerGroupId)
|
peerLeftRevealOptions = leftRevealOptions(strings: item.presentationData.strings, theme: item.presentationData.theme, isUnread: unreadCount.unread, isEditing: item.editing, isPinned: isPinned, isSavedMessages: itemPeer.peerId == item.account.peerId, groupId: item.peerGroupId)
|
||||||
|
} else {
|
||||||
|
peerLeftRevealOptions = []
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
peerRevealOptions = []
|
peerRevealOptions = []
|
||||||
peerLeftRevealOptions = []
|
peerLeftRevealOptions = []
|
||||||
|
@ -210,8 +210,8 @@ private func mappedInsertEntries(account: Account, nodeInteraction: ChatListNode
|
|||||||
}
|
}
|
||||||
case let .HoleEntry(_, theme):
|
case let .HoleEntry(_, theme):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint)
|
||||||
case let .GroupReferenceEntry(index, presentationData, groupId, peer, message, editing, unreadState, revealed, hiddenByDefault):
|
case let .GroupReferenceEntry(index, presentationData, groupId, peers, editing, unreadState, revealed, hiddenByDefault):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, peer: peer, message: message, unreadState: unreadState, hiddenByDefault: hiddenByDefault), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, hiddenOffset: hiddenByDefault && !revealed, interaction: nodeInteraction), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, peers: peers, unreadState: unreadState, hiddenByDefault: hiddenByDefault), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, hiddenOffset: hiddenByDefault && !revealed, interaction: nodeInteraction), directionHint: entry.directionHint)
|
||||||
case let .ArchiveIntro(presentationData):
|
case let .ArchiveIntro(presentationData):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListArchiveInfoItem(theme: presentationData.theme, strings: presentationData.strings), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListArchiveInfoItem(theme: presentationData.theme, strings: presentationData.strings), directionHint: entry.directionHint)
|
||||||
}
|
}
|
||||||
@ -249,8 +249,8 @@ private func mappedUpdateEntries(account: Account, nodeInteraction: ChatListNode
|
|||||||
}
|
}
|
||||||
case let .HoleEntry(_, theme):
|
case let .HoleEntry(_, theme):
|
||||||
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint)
|
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListHoleItem(theme: theme), directionHint: entry.directionHint)
|
||||||
case let .GroupReferenceEntry(index, presentationData, groupId, peer, message, editing, unreadState, revealed, hiddenByDefault):
|
case let .GroupReferenceEntry(index, presentationData, groupId, peers, editing, unreadState, revealed, hiddenByDefault):
|
||||||
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, peer: peer, message: message, unreadState: unreadState, hiddenByDefault: hiddenByDefault), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, hiddenOffset: hiddenByDefault && !revealed, interaction: nodeInteraction), directionHint: entry.directionHint)
|
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListItem(presentationData: presentationData, account: account, peerGroupId: peerGroupId, index: index, content: .groupReference(groupId: groupId, peers: peers, unreadState: unreadState, hiddenByDefault: hiddenByDefault), editing: editing, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: true, hiddenOffset: hiddenByDefault && !revealed, interaction: nodeInteraction), directionHint: entry.directionHint)
|
||||||
case let .ArchiveIntro(presentationData):
|
case let .ArchiveIntro(presentationData):
|
||||||
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListArchiveInfoItem(theme: presentationData.theme, strings: presentationData.strings), directionHint: entry.directionHint)
|
return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ChatListArchiveInfoItem(theme: presentationData.theme, strings: presentationData.strings), directionHint: entry.directionHint)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ enum ChatListNodeEntryId: Hashable {
|
|||||||
enum ChatListNodeEntry: Comparable, Identifiable {
|
enum ChatListNodeEntry: Comparable, Identifiable {
|
||||||
case PeerEntry(index: ChatListIndex, presentationData: ChatListPresentationData, message: Message?, readState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, embeddedInterfaceState: PeerChatListEmbeddedInterfaceState?, peer: RenderedPeer, presence: PeerPresence?, summaryInfo: ChatListMessageTagSummaryInfo, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool)
|
case PeerEntry(index: ChatListIndex, presentationData: ChatListPresentationData, message: Message?, readState: CombinedPeerReadState?, notificationSettings: PeerNotificationSettings?, embeddedInterfaceState: PeerChatListEmbeddedInterfaceState?, peer: RenderedPeer, presence: PeerPresence?, summaryInfo: ChatListMessageTagSummaryInfo, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, inputActivities: [(Peer, PeerInputActivity)]?, isAd: Bool)
|
||||||
case HoleEntry(ChatListHole, theme: PresentationTheme)
|
case HoleEntry(ChatListHole, theme: PresentationTheme)
|
||||||
case GroupReferenceEntry(index: ChatListIndex, presentationData: ChatListPresentationData, groupId: PeerGroupId, peer: RenderedPeer, message: Message?, editing: Bool, unreadState: PeerGroupUnreadCountersCombinedSummary, revealed: Bool, hiddenByDefault: Bool)
|
case GroupReferenceEntry(index: ChatListIndex, presentationData: ChatListPresentationData, groupId: PeerGroupId, peers: [RenderedPeer], editing: Bool, unreadState: PeerGroupUnreadCountersCombinedSummary, revealed: Bool, hiddenByDefault: Bool)
|
||||||
case ArchiveIntro(presentationData: ChatListPresentationData)
|
case ArchiveIntro(presentationData: ChatListPresentationData)
|
||||||
|
|
||||||
var sortIndex: ChatListIndex {
|
var sortIndex: ChatListIndex {
|
||||||
@ -21,7 +21,7 @@ enum ChatListNodeEntry: Comparable, Identifiable {
|
|||||||
return index
|
return index
|
||||||
case let .HoleEntry(hole, _):
|
case let .HoleEntry(hole, _):
|
||||||
return ChatListIndex(pinningIndex: nil, messageIndex: hole.index)
|
return ChatListIndex(pinningIndex: nil, messageIndex: hole.index)
|
||||||
case let .GroupReferenceEntry(index, _, _, _, _, _, _, _, _):
|
case let .GroupReferenceEntry(index, _, _, _, _, _, _, _):
|
||||||
return index
|
return index
|
||||||
case .ArchiveIntro:
|
case .ArchiveIntro:
|
||||||
return ChatListIndex.absoluteUpperBound
|
return ChatListIndex.absoluteUpperBound
|
||||||
@ -34,7 +34,7 @@ enum ChatListNodeEntry: Comparable, Identifiable {
|
|||||||
return .PeerId(index.messageIndex.id.peerId.toInt64())
|
return .PeerId(index.messageIndex.id.peerId.toInt64())
|
||||||
case let .HoleEntry(hole, _):
|
case let .HoleEntry(hole, _):
|
||||||
return .Hole(Int64(hole.index.id.id))
|
return .Hole(Int64(hole.index.id.id))
|
||||||
case let .GroupReferenceEntry(_, _, groupId, _, _, _, _, _, _):
|
case let .GroupReferenceEntry(_, _, groupId, _, _, _, _, _):
|
||||||
return .GroupId(groupId)
|
return .GroupId(groupId)
|
||||||
case .ArchiveIntro:
|
case .ArchiveIntro:
|
||||||
return .ArchiveIntro
|
return .ArchiveIntro
|
||||||
@ -128,8 +128,8 @@ enum ChatListNodeEntry: Comparable, Identifiable {
|
|||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case let .GroupReferenceEntry(lhsIndex, lhsPresentationData, lhsGroupId, lhsPeer, lhsMessage, lhsEditing, lhsUnreadState, lhsRevealed, lhsHiddenByDefault):
|
case let .GroupReferenceEntry(lhsIndex, lhsPresentationData, lhsGroupId, lhsPeers, lhsEditing, lhsUnreadState, lhsRevealed, lhsHiddenByDefault):
|
||||||
if case let .GroupReferenceEntry(rhsIndex, rhsPresentationData, rhsGroupId, rhsPeer, rhsMessage, rhsEditing, rhsUnreadState, rhsRevealed, rhsHiddenByDefault) = rhs {
|
if case let .GroupReferenceEntry(rhsIndex, rhsPresentationData, rhsGroupId, rhsPeers, rhsEditing, rhsUnreadState, rhsRevealed, rhsHiddenByDefault) = rhs {
|
||||||
if lhsIndex != rhsIndex {
|
if lhsIndex != rhsIndex {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -139,13 +139,7 @@ enum ChatListNodeEntry: Comparable, Identifiable {
|
|||||||
if lhsGroupId != rhsGroupId {
|
if lhsGroupId != rhsGroupId {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if lhsPeer != rhsPeer {
|
if lhsPeers != rhsPeers {
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsMessage?.stableVersion != rhsMessage?.stableVersion {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsMessage?.id != rhsMessage?.id || lhsMessage?.flags != rhsMessage?.flags {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if lhsEditing != rhsEditing {
|
if lhsEditing != rhsEditing {
|
||||||
@ -193,10 +187,8 @@ func chatListNodeEntriesForView(_ view: ChatListView, state: ChatListNodeState,
|
|||||||
if view.laterIndex == nil, case .chatList = mode {
|
if view.laterIndex == nil, case .chatList = mode {
|
||||||
var groupEntryCount = 0
|
var groupEntryCount = 0
|
||||||
for groupReference in view.groupEntries {
|
for groupReference in view.groupEntries {
|
||||||
if let _ = groupReference.message {
|
|
||||||
groupEntryCount += 1
|
groupEntryCount += 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
pinnedIndexOffset += UInt16(groupEntryCount)
|
pinnedIndexOffset += UInt16(groupEntryCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,13 +241,8 @@ func chatListNodeEntriesForView(_ view: ChatListView, state: ChatListNodeState,
|
|||||||
|
|
||||||
if view.laterIndex == nil, case .chatList = mode {
|
if view.laterIndex == nil, case .chatList = mode {
|
||||||
for groupReference in view.groupEntries {
|
for groupReference in view.groupEntries {
|
||||||
let messageIndex: MessageIndex
|
let messageIndex = MessageIndex(id: MessageId(peerId: PeerId(namespace: 0, id: 0), namespace: 0, id: 0), timestamp: 1)
|
||||||
if let message = groupReference.message {
|
result.append(.GroupReferenceEntry(index: ChatListIndex(pinningIndex: pinningIndex, messageIndex: messageIndex), presentationData: state.presentationData, groupId: groupReference.groupId, peers: groupReference.renderedPeers, editing: state.editing, unreadState: groupReference.unreadState, revealed: state.archiveShouldBeTemporaryRevealed, hiddenByDefault: hideArchivedFolderByDefault))
|
||||||
messageIndex = message.index
|
|
||||||
} else {
|
|
||||||
messageIndex = MessageIndex(id: MessageId(peerId: groupReference.renderedPeer.peerId, namespace: 0, id: 0), timestamp: 1)
|
|
||||||
}
|
|
||||||
result.append(.GroupReferenceEntry(index: ChatListIndex(pinningIndex: pinningIndex, messageIndex: messageIndex), presentationData: state.presentationData, groupId: groupReference.groupId, peer: groupReference.renderedPeer, message: groupReference.message, editing: state.editing, unreadState: groupReference.unreadState, revealed: state.archiveShouldBeTemporaryRevealed, hiddenByDefault: hideArchivedFolderByDefault))
|
|
||||||
if pinningIndex != 0 {
|
if pinningIndex != 0 {
|
||||||
pinningIndex -= 1
|
pinningIndex -= 1
|
||||||
}
|
}
|
||||||
|
@ -1174,7 +1174,7 @@ final class ChatListSearchContainerNode: SearchDisplayControllerContentNode {
|
|||||||
switch item.content {
|
switch item.content {
|
||||||
case let .peer(message, peer, _, _, _, _, _, _, _, _):
|
case let .peer(message, peer, _, _, _, _, _, _, _, _):
|
||||||
return (selectedItemNode.view, bounds, message?.id ?? peer.peerId)
|
return (selectedItemNode.view, bounds, message?.id ?? peer.peerId)
|
||||||
case let .groupReference(groupId, _, _, _, _):
|
case let .groupReference(groupId, _, _, _):
|
||||||
return (selectedItemNode.view, bounds, groupId)
|
return (selectedItemNode.view, bounds, groupId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user