Fix sending messages from "View as Messages".

This commit is contained in:
John Preston 2023-11-06 12:06:21 +04:00
parent 332ae22111
commit 20ba417ddd

View file

@ -3580,7 +3580,14 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
sendAction(action);
const auto clearCloudDraft = action.clearDraft;
const auto topicRootId = action.replyTo.topicRootId;
const auto replyTo = action.replyTo.messageId
? peer->owner().message(action.replyTo.messageId)
: nullptr;
const auto topicRootId = action.replyTo.topicRootId
? action.replyTo.topicRootId
: replyTo
? replyTo->topicRootId()
: Data::ForumTopic::kGeneralId;
const auto topic = peer->forumTopicFor(topicRootId);
if (!(topic ? Data::CanSendTexts(topic) : Data::CanSendTexts(peer))
|| Api::SendDice(message)) {