2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Several crashes fixed.

This commit is contained in:
John Preston
2016-04-14 22:24:42 +03:00
parent d6070c37d1
commit bb70a76b9c
22 changed files with 195 additions and 166 deletions

View File

@@ -124,8 +124,14 @@ void HashtagClickHandler::onClick(Qt::MouseButton button) const {
void BotCommandClickHandler::onClick(Qt::MouseButton button) const {
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
if (PeerData *peer = Ui::getPeerForMouseAction()) {
UserData *bot = peer->isUser() ? peer->asUser() : nullptr;
if (auto item = App::hoveredLinkItem()) {
if (!bot) {
bot = item->fromOriginal()->asUser(); // may return nullptr
}
}
Ui::showPeerHistory(peer, ShowAtTheEndMsgId);
App::sendBotCommand(peer, _cmd);
App::sendBotCommand(peer, bot, _cmd);
} else {
App::insertBotCommand(_cmd);
}