mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 23:55:12 +00:00
Support custom attach bot icons.
This commit is contained in:
@@ -383,16 +383,22 @@ void SessionNavigation::showPeerByLinkResolved(
|
||||
msgId = ShowAtUnreadMsgId;
|
||||
}
|
||||
const auto attachBotUsername = info.attachBotUsername;
|
||||
if (user && user->isBot()) {
|
||||
if (user
|
||||
&& user->isBot()
|
||||
&& user->botInfo->startToken != info.startToken) {
|
||||
user->botInfo->startToken = info.startToken;
|
||||
user->session().changes().peerUpdated(
|
||||
user,
|
||||
Data::PeerUpdate::Flag::BotStartToken);
|
||||
}
|
||||
crl::on_main(this, [=] {
|
||||
showPeerHistory(peer->id, params, msgId);
|
||||
peer->session().attachWebView().request(peer, attachBotUsername);
|
||||
});
|
||||
if (user && info.attachBotToggle) {
|
||||
user->session().attachWebView().requestAddToMenu(user);
|
||||
} else {
|
||||
crl::on_main(this, [=] {
|
||||
showPeerHistory(peer->id, params, msgId);
|
||||
peer->session().attachWebView().request(peer, attachBotUsername);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user