Various improvements

This commit is contained in:
Isaac
2023-12-28 20:11:23 +04:00
parent d8e5ff4f58
commit 24b7482bf9
3 changed files with 12 additions and 6 deletions

View File

@@ -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