2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Show rank in anonymous outgoing messages.

This commit is contained in:
John Preston
2020-10-06 10:23:58 +03:00
parent 26c7a95a9f
commit 22a85016e3
5 changed files with 93 additions and 65 deletions

View File

@@ -1601,6 +1601,28 @@ void HistoryMessage::setViewsCount(int count) {
void HistoryMessage::setForwardsCount(int count) {
}
void HistoryMessage::setPostAuthor(const QString &author) {
auto msgsigned = Get<HistoryMessageSigned>();
if (author.isEmpty()) {
if (!msgsigned) {
return;
}
RemoveComponents(HistoryMessageSigned::Bit());
history()->owner().requestItemResize(this);
return;
}
if (!msgsigned) {
AddComponents(HistoryMessageSigned::Bit());
msgsigned = Get<HistoryMessageSigned>();
} else if (msgsigned->author == author) {
return;
}
msgsigned->author = author;
msgsigned->isAnonymousRank = !isDiscussionPost()
&& this->author()->isMegagroup();
history()->owner().requestItemResize(this);
}
void HistoryMessage::setReplies(const MTPMessageReplies &data) {
data.match([&](const MTPDmessageReplies &data) {
auto views = Get<HistoryMessageViews>();