mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Topic Author badge only if not admin.
This commit is contained in:
parent
7ec1af5e50
commit
f13a2517cd
1 changed files with 6 additions and 8 deletions
|
@ -329,10 +329,7 @@ not_null<HistoryMessage*> Message::message() const {
|
||||||
|
|
||||||
void Message::refreshRightBadge() {
|
void Message::refreshRightBadge() {
|
||||||
const auto text = [&] {
|
const auto text = [&] {
|
||||||
const auto author = delegate()->elementAuthorRank(this);
|
if (data()->isDiscussionPost()) {
|
||||||
if (!author.isEmpty()) {
|
|
||||||
return author;
|
|
||||||
} else if (data()->isDiscussionPost()) {
|
|
||||||
return (delegate()->elementContext() == Context::Replies)
|
return (delegate()->elementContext() == Context::Replies)
|
||||||
? QString()
|
? QString()
|
||||||
: tr::lng_channel_badge(tr::now);
|
: tr::lng_channel_badge(tr::now);
|
||||||
|
@ -362,12 +359,13 @@ void Message::refreshRightBadge() {
|
||||||
? tr::lng_admin_badge(tr::now)
|
? tr::lng_admin_badge(tr::now)
|
||||||
: QString();
|
: QString();
|
||||||
}();
|
}();
|
||||||
if (text.isEmpty()) {
|
const auto badge = text.isEmpty()
|
||||||
|
? delegate()->elementAuthorRank(this)
|
||||||
|
: TextUtilities::RemoveEmoji(TextUtilities::SingleLine(text));
|
||||||
|
if (badge.isEmpty()) {
|
||||||
_rightBadge.clear();
|
_rightBadge.clear();
|
||||||
} else {
|
} else {
|
||||||
_rightBadge.setText(
|
_rightBadge.setText(st::defaultTextStyle, badge);
|
||||||
st::defaultTextStyle,
|
|
||||||
TextUtilities::RemoveEmoji(TextUtilities::SingleLine(text)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue