Various improvements

This commit is contained in:
Ilya Laktyushin 2026-04-28 14:31:17 +02:00
parent 1793490519
commit 73d25e7be3
25 changed files with 421 additions and 126 deletions

View file

@ -1591,3 +1591,22 @@ public func canSendMessagesToChat(_ state: ChatPresentationInterfaceState) -> Bo
return false
}
}
public func canSendReactionsToChat(_ state: ChatPresentationInterfaceState) -> Bool {
if let peer = state.renderedPeer?.peer {
let canBypassRestrictions = canBypassRestrictions(chatPresentationInterfaceState: state)
return canSendReactionsToPeer(EnginePeer(peer), ignoreDefault: canBypassRestrictions)
} else if case .customChatContents = state.chatLocation {
if case let .customChatContents(contents) = state.subject {
if case .hashTagSearch = contents.kind {
return false
} else {
return true
}
} else {
return true
}
} else {
return false
}
}