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

Better General topic support.

This commit is contained in:
John Preston
2022-11-29 17:48:51 +04:00
parent 7866013ab6
commit 01748d8aba
6 changed files with 46 additions and 25 deletions

View File

@@ -3490,10 +3490,12 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
const auto replyTo = replyToId
? peer->owner().message(peer, replyToId)
: nullptr;
const auto topicRootId = replyTo ? replyTo->topicRootId() : replyToId;
const auto topic = topicRootId
? peer->forumTopicFor(topicRootId)
: nullptr;
const auto topicRootId = replyTo
? replyTo->topicRootId()
: action.topicRootId
? action.topicRootId
: Data::ForumTopic::kGeneralId;
const auto topic = peer->forumTopicFor(topicRootId);
if (!(topic ? topic->canWrite() : peer->canWrite())
|| Api::SendDice(message)) {
return;