diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift index 7def4f6902..fa6adc5c72 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift @@ -1645,7 +1645,10 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI if case .admin = authorRank { } else if case .owner = authorRank { } else if authorRank == nil { - enableAutoRank = true + if case let .replyThread(replyThreadMessage) = item.chatLocation, replyThreadMessage.peerId == item.context.account.peerId { + } else { + enableAutoRank = true + } } if enableAutoRank { if let topicAuthorId = item.associatedData.topicAuthorId, topicAuthorId == message.author?.id { diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 6c1fb5d1f8..6c89098627 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -3023,7 +3023,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } } - if canReplyInChat(strongSelf.presentationInterfaceState) { + if canReplyInChat(strongSelf.presentationInterfaceState, accountPeerId: strongSelf.context.account.peerId) { return .reply } else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info { } @@ -17475,7 +17475,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } if options.contains(.deleteLocally) { var localOptionText = self.presentationData.strings.Conversation_DeleteMessagesForMe - if case .peer(self.context.account.peerId) = self.chatLocation { + if self.chatLocation.peerId == self.context.account.peerId { //TODO:localize localOptionText = "Remove from Saved Messages" } else if case .scheduledMessages = self.presentationInterfaceState.subject { @@ -18014,7 +18014,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G ) ) - if canReplyInChat(self.presentationInterfaceState) { + if canReplyInChat(self.presentationInterfaceState, accountPeerId: self.context.account.peerId) { inputShortcuts.append( KeyShortcut( input: UIKeyCommand.inputUpArrow, diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index 055d0bbb9e..e649ef04cc 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -249,7 +249,7 @@ private func canViewReadStats(message: Message, participantCount: Int?, isMessag return true } -func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceState) -> Bool { +func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, accountPeerId: PeerId) -> Bool { guard let peer = chatPresentationInterfaceState.renderedPeer?.peer else { return false } @@ -272,6 +272,9 @@ func canReplyInChat(_ chatPresentationInterfaceState: ChatPresentationInterfaceS default: break } + if case let .replyThread(replyThreadMessage) = chatPresentationInterfaceState.chatLocation, replyThreadMessage.peerId == accountPeerId { + return false + } if let channel = peer as? TelegramChannel, channel.flags.contains(.isForum) { if let threadData = chatPresentationInterfaceState.threadData { @@ -611,7 +614,7 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState } } - var canReply = canReplyInChat(chatPresentationInterfaceState) + var canReply = canReplyInChat(chatPresentationInterfaceState, accountPeerId: context.account.peerId) var canPin = false let canSelect = !isAction