diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 990678304..02e3bb9c1 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3579,14 +3579,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) { action.generateLocal = true; sendAction(action); - const auto replyTo = action.replyTo.messageId - ? peer->owner().message(action.replyTo.messageId) - : nullptr; - const auto topicRootId = replyTo - ? replyTo->topicRootId() - : action.replyTo.topicRootId - ? action.replyTo.topicRootId - : Data::ForumTopic::kGeneralId; + const auto clearCloudDraft = action.clearDraft; + const auto topicRootId = action.replyTo.topicRootId; const auto topic = peer->forumTopicFor(topicRootId); if (!(topic ? Data::CanSendTexts(topic) : Data::CanSendTexts(peer)) || Api::SendDice(message)) { @@ -3682,8 +3676,6 @@ void ApiWrap::sendMessage(MessageToSend &&message) { sendFlags |= MTPmessages_SendMessage::Flag::f_entities; mediaFlags |= MTPmessages_SendMedia::Flag::f_entities; } - const auto clearCloudDraft = action.clearDraft; - const auto topicRootId = action.replyTo.topicRootId; if (clearCloudDraft) { sendFlags |= MTPmessages_SendMessage::Flag::f_clear_draft; mediaFlags |= MTPmessages_SendMedia::Flag::f_clear_draft;