From 4dd58b79e989124bf0eebf2f10f53ede347426d1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 18 Aug 2021 16:43:22 +0300 Subject: [PATCH] Fix forward of a bot message with a game from a group. --- Telegram/SourceFiles/history/history_message.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index e266574596..829e2dd3cb 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -602,9 +602,11 @@ HistoryMessage::HistoryMessage( if (const auto fwdViaBot = original->viaBot()) { config.viaBotId = peerToUser(fwdViaBot->id); } else if (originalMedia && originalMedia->game()) { - if (const auto user = original->history()->peer->asUser()) { - if (user->isBot()) { - config.viaBotId = peerToUser(user->id); + if (const auto sender = original->senderOriginal()) { + if (const auto user = sender->asUser()) { + if (user->isBot()) { + config.viaBotId = peerToUser(user->id); + } } } }