From e63330f75478025a63f6fe48841f7b38c8acbf34 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Wed, 27 Jan 2021 21:08:20 +0500 Subject: [PATCH] Chat import fixes --- Telegram/Telegram-iOS/en.lproj/Localizable.strings | 2 +- .../GalleryUI/Sources/ChatItemGalleryFooterContentNode.swift | 4 +++- .../Sources/ChatMessageAnimatedStickerItemNode.swift | 2 ++ .../TelegramUI/Sources/ChatMessageStickerItemNode.swift | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index e8d5885b13..2be2c6b979 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -5936,7 +5936,7 @@ Sorry for the inconvenience."; "ChatImport.Title" = "Select Chat"; "ChatImport.SelectionErrorNotAdmin" = "You need to be an admin of the group to import messages into it."; -"ChatImport.SelectionErrorGroupGeneric" = "You can't import history into this group."; +"ChatImport.SelectionErrorGroupGeneric" = "You can't import history to this group."; "ChatImport.SelectionConfirmationGroupWithTitle" = "Are you sure you want to import messages from **%1$@** into **%2$@**?"; "ChatImport.SelectionConfirmationGroupWithoutTitle" = "Are you sure you want to import messages into **%@**?"; "ChatImport.SelectionConfirmationAlertTitle" = "Import Messages"; diff --git a/submodules/GalleryUI/Sources/ChatItemGalleryFooterContentNode.swift b/submodules/GalleryUI/Sources/ChatItemGalleryFooterContentNode.swift index 8e230946bf..c4bd71e596 100644 --- a/submodules/GalleryUI/Sources/ChatItemGalleryFooterContentNode.swift +++ b/submodules/GalleryUI/Sources/ChatItemGalleryFooterContentNode.swift @@ -491,7 +491,9 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll var authorNameText: String? - if let author = message.effectiveAuthor { + if let forwardInfo = message.forwardInfo, forwardInfo.flags.contains(.isImported), let authorSignature = forwardInfo.authorSignature { + authorNameText = authorSignature + } else if let author = message.effectiveAuthor { authorNameText = author.displayTitle(strings: self.strings, displayOrder: self.nameOrder) } else if let peer = message.peers[message.id.peerId] { authorNameText = peer.displayTitle(strings: self.strings, displayOrder: self.nameOrder) diff --git a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift index bea85e4dc9..e28f137cb9 100644 --- a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift @@ -1251,6 +1251,8 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { if item.effectiveAuthorId?.namespace == Namespaces.Peer.Empty { item.controllerInteraction.displayMessageTooltip(item.content.firstMessage.id, item.presentationData.strings.Conversation_ForwardAuthorHiddenTooltip, self, avatarNode.frame) + } else if let forwardInfo = item.content.firstMessage.forwardInfo, forwardInfo.flags.contains(.isImported), forwardInfo.author == nil { + item.controllerInteraction.displayImportedMessageTooltip(avatarNode) } else { if !item.message.id.peerId.isReplies, let channel = item.content.firstMessage.forwardInfo?.author as? TelegramChannel, channel.username == nil { if case .member = channel.participationStatus { diff --git a/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift index 93b49a999e..da2ccb6945 100644 --- a/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageStickerItemNode.swift @@ -818,6 +818,8 @@ class ChatMessageStickerItemNode: ChatMessageItemView { if item.effectiveAuthorId?.namespace == Namespaces.Peer.Empty { item.controllerInteraction.displayMessageTooltip(item.content.firstMessage.id, item.presentationData.strings.Conversation_ForwardAuthorHiddenTooltip, self, avatarNode.frame) + } else if let forwardInfo = item.content.firstMessage.forwardInfo, forwardInfo.flags.contains(.isImported), forwardInfo.author == nil { + item.controllerInteraction.displayImportedMessageTooltip(avatarNode) } else { if !item.message.id.peerId.isReplies, let channel = item.content.firstMessage.forwardInfo?.author as? TelegramChannel, channel.username == nil { if case .member = channel.participationStatus {