mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 16:13:56 +02:00
fix: channel badge
This commit is contained in:
parent
6027bad788
commit
b5c769196a
1 changed files with 17 additions and 4 deletions
|
@ -479,6 +479,22 @@ void Message::setReactions(std::unique_ptr<Reactions::InlineList> list) {
|
|||
|
||||
void Message::refreshRightBadge() {
|
||||
const auto item = data();
|
||||
const auto drawChannelBadge = [&]
|
||||
{
|
||||
if (item->isDiscussionPost()) {
|
||||
return (delegate()->elementContext() != Context::Replies);
|
||||
} else if (item->author()->isMegagroup()) {
|
||||
if (const auto msgsigned = item->Get<HistoryMessageSigned>()) {
|
||||
if (!msgsigned->viaBusinessBot) {
|
||||
Assert(msgsigned->isAnonymousRank);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (data()->history()->peer->isMegagroup() && data()->author()->isChannel() && !data()->out()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
const auto text = [&] {
|
||||
if (item->isDiscussionPost()) {
|
||||
return (delegate()->elementContext() == Context::Replies)
|
||||
|
@ -537,10 +553,7 @@ void Message::refreshRightBadge() {
|
|||
badge.append(' ').append(Ui::Text::Colorized(added, 1));
|
||||
}
|
||||
_rightBadgeIsChannel = 0;
|
||||
if (
|
||||
item->isDiscussionPost() && delegate()->elementContext() != Context::Replies ||
|
||||
data()->history()->peer->isMegagroup() && data()->author()->isChannel() && !data()->out()
|
||||
) {
|
||||
if (drawChannelBadge) {
|
||||
_rightBadgeIsChannel = 1;
|
||||
}
|
||||
if (badge.empty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue