2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Show monoforums as forums in chats list.

This commit is contained in:
John Preston
2025-05-16 16:29:40 +04:00
parent 5dc50b6d96
commit 358e64f2cc
22 changed files with 303 additions and 75 deletions

View File

@@ -60,14 +60,14 @@ MTPInputReplyTo ReplyToForMTP(
&& (to->history() != history || to->id != replyingToTopicId))
? to->topicRootId()
: replyingToTopicId;
const auto possibleMonoforumPeer = (to && to->savedSublistPeer())
? to->savedSublistPeer()
const auto possibleMonoforumPeerId = (to && to->sublistPeerId())
? to->sublistPeerId()
: replyTo.monoforumPeerId
? history->owner().peer(replyTo.monoforumPeerId).get()
: history->session().user().get();
const auto replyToMonoforumPeer = history->peer->amMonoforumAdmin()
? possibleMonoforumPeer
: nullptr;
? replyTo.monoforumPeerId
: history->session().user()->id;
const auto replyToMonoforumPeerId = history->peer->amMonoforumAdmin()
? possibleMonoforumPeerId
: PeerId();
const auto external = replyTo.messageId
&& (replyTo.messageId.peer != history->peer->id
|| replyingToTopicId != replyToTopicId);
@@ -82,7 +82,9 @@ MTPInputReplyTo ReplyToForMTP(
| (replyTo.quote.text.isEmpty()
? Flag()
: (Flag::f_quote_text | Flag::f_quote_offset))
| (replyToMonoforumPeer ? Flag::f_monoforum_peer_id : Flag())
| (replyToMonoforumPeerId
? Flag::f_monoforum_peer_id
: Flag())
| (quoteEntities.v.isEmpty()
? Flag()
: Flag::f_quote_entities)),
@@ -94,8 +96,8 @@ MTPInputReplyTo ReplyToForMTP(
MTP_string(replyTo.quote.text),
quoteEntities,
MTP_int(replyTo.quoteOffset),
(replyToMonoforumPeer
? replyToMonoforumPeer->input
(replyToMonoforumPeerId
? history->owner().peer(replyToMonoforumPeerId)->input
: MTPInputPeer()));
} else if (history->peer->amMonoforumAdmin()
&& replyTo.monoforumPeerId) {