2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Support attach webview bots in topics.

This commit is contained in:
John Preston
2022-10-28 11:57:09 +04:00
parent b3f9b16eb2
commit aa5f9467f2
11 changed files with 165 additions and 66 deletions

View File

@@ -394,9 +394,10 @@ void SessionNavigation::showPeerByLinkResolved(
}
if (!attachBotUsername.isEmpty()) {
crl::on_main(this, [=] {
showPeerHistory(peer->id, params, msgId);
const auto history = peer->owner().history(peer);
showPeerHistory(history, params, msgId);
peer->session().attachWebView().request(
peer,
Api::SendAction(history),
attachBotUsername,
info.attachBotToggleCommand.value_or(QString()));
});
@@ -410,7 +411,10 @@ void SessionNavigation::showPeerByLinkResolved(
? contextPeer->asUser()
: nullptr;
bot->session().attachWebView().requestAddToMenu(
contextUser,
(contextUser
? Api::SendAction(
contextUser->owner().history(contextUser))
: std::optional<Api::SendAction>()),
bot,
*info.attachBotToggleCommand,
parentController(),