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

Remove unsupported actions from monoforum menu.

This commit is contained in:
John Preston
2025-05-30 16:26:06 +04:00
parent 3278de9ba1
commit 0d43f16db2
4 changed files with 27 additions and 6 deletions

View File

@@ -1206,6 +1206,8 @@ int PeerData::nameVersion() const {
const QString &PeerData::name() const {
if (const auto to = migrateTo()) {
return to->name();
} else if (const auto broadcast = monoforumBroadcast()) {
return broadcast->name();
}
return _name;
}
@@ -1213,6 +1215,10 @@ const QString &PeerData::name() const {
const QString &PeerData::shortName() const {
if (const auto user = asUser()) {
return user->firstName.isEmpty() ? user->lastName : user->firstName;
} else if (const auto to = migrateTo()) {
return to->shortName();
} else if (const auto broadcast = monoforumBroadcast()) {
return broadcast->shortName();
}
return _name;
}
@@ -1554,7 +1560,8 @@ bool PeerData::canRevokeFullHistory() const {
} else if (const auto megagroup = asMegagroup()) {
return megagroup->amCreator()
&& megagroup->membersCountKnown()
&& megagroup->canDelete();
&& megagroup->canDelete()
&& !megagroup->isMonoforum();
}
return false;
}