2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Proof-of-concept custom verify badges.

This commit is contained in:
John Preston
2024-12-10 20:59:32 +04:00
parent 35e40be550
commit 6f18b9b691
25 changed files with 437 additions and 195 deletions

View File

@@ -44,6 +44,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/empty_userpic.h"
#include "ui/text/text_options.h"
#include "ui/painter.h"
#include "ui/unread_badge.h"
#include "ui/ui_utility.h"
#include "history/history.h"
#include "history/view/history_view_element.h"
@@ -1246,6 +1247,22 @@ void PeerData::setStoriesHidden(bool hidden) {
}
}
Ui::VerifyDetails *PeerData::verifyDetails() const {
if (const auto user = asUser()) {
return user->verifyDetails();
} else if (const auto channel = asChannel()) {
return channel->verifyDetails();
}
return nullptr;
}
bool PeerData::verifiedByTelegram() const {
if (const auto details = verifyDetails()) {
return (details->iconBgId == owner().verifiedByTelegram().iconBgId);
}
return false;
}
Data::Forum *PeerData::forum() const {
if (const auto channel = asChannel()) {
return channel->forum();