[WIP] Topics

This commit is contained in:
Ali
2022-10-04 18:19:39 +04:00
parent 533085c77a
commit 62697d4ffb
83 changed files with 1974 additions and 1650 deletions

View File

@@ -242,12 +242,14 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
botPeer = message.author
}
var peerId: PeerId?
var peer: Peer?
if samePeer {
peerId = message.id.peerId
peer = message.peers[message.id.peerId]
} else {
peer = botPeer
}
if let botPeer = botPeer, let addressName = botPeer.addressName {
self.controllerInteraction.openPeer(peerId, .chat(textInputState: ChatTextInputState(inputText: NSAttributedString(string: "@\(addressName) \(query)")), subject: nil, peekData: nil), nil, false, nil)
if let peer = peer, let botPeer = botPeer, let addressName = botPeer.addressName {
self.controllerInteraction.openPeer(EnginePeer(peer), .chat(textInputState: ChatTextInputState(inputText: NSAttributedString(string: "@\(addressName) \(query)")), subject: nil, peekData: nil), nil, false)
}
}
case .payment:
@@ -259,7 +261,13 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
case let .setupPoll(isQuiz):
self.controllerInteraction.openPollCreation(isQuiz)
case let .openUserProfile(peerId):
self.controllerInteraction.openPeer(peerId, .info, nil, false, nil)
let _ = (self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: peerId))
|> deliverOnMainQueue).start(next: { [weak self] peer in
guard let self, let peer else {
return
}
self.controllerInteraction.openPeer(peer, .info, nil, false)
})
case let .openWebView(url, simple):
self.controllerInteraction.openWebView(markupButton.title, url, simple, false)
}