Add support for app ads

This commit is contained in:
Ilya Laktyushin
2023-11-17 03:13:55 +04:00
parent f66b521e2f
commit e8e2d419c5
8 changed files with 106 additions and 35 deletions

View File

@@ -4102,6 +4102,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
self.controllerInteraction?.openJoinLink(joinHash)
case let .webPage(_, url):
self.controllerInteraction?.openUrl(ChatControllerInteraction.OpenUrl(url: url, concealed: false, external: false))
case let .botApp(peerId, botApp, startParam):
let _ = (self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: peerId))
|> deliverOnMainQueue).startStandalone(next: { [weak self] peer in
if let self, let peer {
self.presentBotApp(botApp: botApp, botPeer: peer, payload: startParam)
}
})
}
}, openRequestedPeerSelection: { [weak self] messageId, peerType, buttonId in
guard let self else {