mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 17:00:13 +00:00
Monoforums
This commit is contained in:
parent
df088af209
commit
66ce61e756
@ -1712,7 +1712,11 @@ private final class NotificationServiceHandler {
|
|||||||
var content = initialContent
|
var content = initialContent
|
||||||
|
|
||||||
if let interactionAuthorId = interactionAuthorId {
|
if let interactionAuthorId = interactionAuthorId {
|
||||||
if inAppNotificationSettings.displayNameOnLockscreen, let peer = transaction.getPeer(interactionAuthorId) {
|
if inAppNotificationSettings.displayNameOnLockscreen, var peer = transaction.getPeer(interactionAuthorId) {
|
||||||
|
if let channel = peer as? TelegramChannel, channel.isMonoForum, let linkedMonoforumId = channel.linkedMonoforumId, let mainChannel = transaction.getPeer(linkedMonoforumId) {
|
||||||
|
peer = mainChannel
|
||||||
|
}
|
||||||
|
|
||||||
var foundLocalId: String?
|
var foundLocalId: String?
|
||||||
transaction.enumerateDeviceContactImportInfoItems({ _, value in
|
transaction.enumerateDeviceContactImportInfoItems({ _, value in
|
||||||
if let value = value as? TelegramDeviceContactImportedData {
|
if let value = value as? TelegramDeviceContactImportedData {
|
||||||
@ -2026,7 +2030,11 @@ private final class NotificationServiceHandler {
|
|||||||
var content = initialContent
|
var content = initialContent
|
||||||
|
|
||||||
if let interactionAuthorId = interactionAuthorId {
|
if let interactionAuthorId = interactionAuthorId {
|
||||||
if inAppNotificationSettings.displayNameOnLockscreen, let peer = transaction.getPeer(interactionAuthorId) {
|
if inAppNotificationSettings.displayNameOnLockscreen, var peer = transaction.getPeer(interactionAuthorId) {
|
||||||
|
if let channel = peer as? TelegramChannel, channel.isMonoForum, let linkedMonoforumId = channel.linkedMonoforumId, let mainChannel = transaction.getPeer(linkedMonoforumId) {
|
||||||
|
peer = mainChannel
|
||||||
|
}
|
||||||
|
|
||||||
var foundLocalId: String?
|
var foundLocalId: String?
|
||||||
transaction.enumerateDeviceContactImportInfoItems({ _, value in
|
transaction.enumerateDeviceContactImportInfoItems({ _, value in
|
||||||
if let value = value as? TelegramDeviceContactImportedData {
|
if let value = value as? TelegramDeviceContactImportedData {
|
||||||
|
|||||||
@ -2990,6 +2990,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
var associatedPeer: EnginePeer?
|
var associatedPeer: EnginePeer?
|
||||||
if case let .secretChat(secretChat) = peer, let associatedPeerId = secretChat.associatedPeerId {
|
if case let .secretChat(secretChat) = peer, let associatedPeerId = secretChat.associatedPeerId {
|
||||||
associatedPeer = renderedPeer.peers[associatedPeerId]
|
associatedPeer = renderedPeer.peers[associatedPeerId]
|
||||||
|
} else if case let .channel(channel) = peer, channel.isMonoForum {
|
||||||
|
associatedPeer = renderedPeer.chatOrMonoforumMainPeer
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.append(.recentlySearchedPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, nil, false))
|
entries.append(.recentlySearchedPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, nil, false))
|
||||||
@ -3001,8 +3003,13 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
|
|
||||||
if lowercasedQuery.count > 1 {
|
if lowercasedQuery.count > 1 {
|
||||||
for peer in recentPeers {
|
for peer in recentPeers {
|
||||||
|
let renderedPeer = peer
|
||||||
if let peer = peer.peer.chatMainPeer, !existingPeerIds.contains(peer.id) {
|
if let peer = peer.peer.chatMainPeer, !existingPeerIds.contains(peer.id) {
|
||||||
let peer = EnginePeer(peer)
|
let peer = EnginePeer(peer)
|
||||||
|
var associatedPeer: EnginePeer?
|
||||||
|
if case let .channel(channel) = peer, channel.isMonoForum {
|
||||||
|
associatedPeer = renderedPeer.peer.chatOrMonoforumMainPeer.flatMap(EnginePeer.init)
|
||||||
|
}
|
||||||
|
|
||||||
var matches = false
|
var matches = false
|
||||||
if case let .user(user) = peer {
|
if case let .user(user) = peer {
|
||||||
@ -3017,7 +3024,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
|
|
||||||
if matches {
|
if matches {
|
||||||
existingPeerIds.insert(peer.id)
|
existingPeerIds.insert(peer.id)
|
||||||
entries.append(.localPeer(peer, nil, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
entries.append(.localPeer(peer, associatedPeer, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3038,6 +3045,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
var associatedPeer: EnginePeer?
|
var associatedPeer: EnginePeer?
|
||||||
if case let .secretChat(secretChat) = peer, let associatedPeerId = secretChat.associatedPeerId {
|
if case let .secretChat(secretChat) = peer, let associatedPeerId = secretChat.associatedPeerId {
|
||||||
associatedPeer = renderedPeer.peers[associatedPeerId]
|
associatedPeer = renderedPeer.peers[associatedPeerId]
|
||||||
|
} else if case let .channel(channel) = peer, channel.isMonoForum {
|
||||||
|
associatedPeer = renderedPeer.chatOrMonoforumMainPeer
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.append(.localPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
entries.append(.localPeer(peer, associatedPeer, foundLocalPeers.unread[peer.id], index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, localExpandType, nil, false, false))
|
||||||
@ -3081,6 +3090,7 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
|
|||||||
|
|
||||||
if !existingPeerIds.contains(peer.peer.id), filteredPeer(EnginePeer(peer.peer), EnginePeer(accountPeer)) {
|
if !existingPeerIds.contains(peer.peer.id), filteredPeer(EnginePeer(peer.peer), EnginePeer(accountPeer)) {
|
||||||
existingPeerIds.insert(peer.peer.id)
|
existingPeerIds.insert(peer.peer.id)
|
||||||
|
|
||||||
entries.append(.globalPeer(peer, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, globalExpandType, nil, false, finalQuery))
|
entries.append(.globalPeer(peer, nil, index, presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder, globalExpandType, nil, false, finalQuery))
|
||||||
index += 1
|
index += 1
|
||||||
numberOfGlobalPeers += 1
|
numberOfGlobalPeers += 1
|
||||||
|
|||||||
@ -335,6 +335,8 @@ public final class AsyncListComponent: Component {
|
|||||||
super.init(layerBacked: false, dynamicBounce: false, rotated: false, seeThrough: false)
|
super.init(layerBacked: false, dynamicBounce: false, rotated: false, seeThrough: false)
|
||||||
|
|
||||||
self.view.addSubview(self.contentContainer)
|
self.view.addSubview(self.contentContainer)
|
||||||
|
|
||||||
|
self.scrollPositioningInsets = UIEdgeInsets(top: -24.0, left: 0.0, bottom: -24.0, right: 0.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user