From 709c18e6fc04a125cc8e35d3f56eb144502c3bb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 6 Jan 2016 18:21:07 +0800 Subject: [PATCH] fixed crash when deleting replyTo msg via inline bot --- Telegram/SourceFiles/history.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 9d3180ad6..cd309b382 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7086,10 +7086,16 @@ HistoryItem *HistoryReply::replyToMessage() const { void HistoryReply::replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem) { if (replyToMsg == oldItem) { + delete _replyToVia; + _replyToVia = 0; replyToMsg = newItem; if (!newItem) { replyToMsgId = 0; initDimensions(); + } else if (!replyToMsg->toHistoryForwarded()) { + if (UserData *bot = replyToMsg->viaBot()) { + _replyToVia = new HistoryMessageVia(peerToUser(bot->id)); + } } } }