mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Monoforums
This commit is contained in:
@@ -105,14 +105,19 @@ public class ChatMessageShareButton: ASDisplayNode {
|
||||
|
||||
public func update(presentationData: ChatPresentationData, controllerInteraction: ChatControllerInteraction, chatLocation: ChatLocation, subject: ChatControllerSubject?, message: Message, account: Account, disableComments: Bool = false) -> CGSize {
|
||||
var isReplies = false
|
||||
var isNavigate = false
|
||||
var replyCount = 0
|
||||
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info {
|
||||
for attribute in message.attributes {
|
||||
if let attribute = attribute as? ReplyThreadMessageAttribute {
|
||||
replyCount = Int(attribute.count)
|
||||
isReplies = true
|
||||
break
|
||||
if let channel = message.peers[message.id.peerId] as? TelegramChannel {
|
||||
if case .broadcast = channel.info {
|
||||
for attribute in message.attributes {
|
||||
if let attribute = attribute as? ReplyThreadMessageAttribute {
|
||||
replyCount = Int(attribute.count)
|
||||
isReplies = true
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if channel.isMonoForum, case .peer = chatLocation {
|
||||
isNavigate = true
|
||||
}
|
||||
}
|
||||
if case let .replyThread(replyThreadMessage) = chatLocation, replyThreadMessage.effectiveTopId == message.id {
|
||||
@@ -147,6 +152,9 @@ public class ChatMessageShareButton: ASDisplayNode {
|
||||
} else if case let .customChatContents(contents) = subject, case .hashTagSearch = contents.kind {
|
||||
updatedIconImage = PresentationResourcesChat.chatFreeNavigateButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
|
||||
updatedIconOffset = CGPoint(x: UIScreenPixel, y: 1.0)
|
||||
} else if isNavigate {
|
||||
updatedIconImage = PresentationResourcesChat.chatFreeNavigateToThreadButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
|
||||
updatedIconOffset = CGPoint(x: UIScreenPixel, y: -3.0)
|
||||
} else if case .pinnedMessages = subject {
|
||||
updatedIconImage = PresentationResourcesChat.chatFreeNavigateButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
|
||||
updatedIconOffset = CGPoint(x: UIScreenPixel, y: 1.0)
|
||||
|
||||
Reference in New Issue
Block a user