2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Added ability to report chat photo and channel photo.

This commit is contained in:
23rd
2022-10-20 17:50:58 +03:00
committed by John Preston
parent f0177bc6cc
commit 6d3f9017fa
5 changed files with 48 additions and 9 deletions

View File

@@ -22,10 +22,18 @@ namespace {
std::variant<v::null_t, MessageIdsList, not_null<PhotoData*>> data) {
const auto source = v::match(data, [](const MessageIdsList &ids) {
return Ui::ReportSource::Message;
}, [](not_null<PhotoData*> photo) {
return photo->hasVideo()
? Ui::ReportSource::ProfileVideo
: Ui::ReportSource::ProfilePhoto;
}, [&](not_null<PhotoData*> photo) {
return peer->isUser()
? (photo->hasVideo()
? Ui::ReportSource::ProfileVideo
: Ui::ReportSource::ProfilePhoto)
: (peer->isChat() || (peer->isChannel() && peer->isMegagroup()))
? (photo->hasVideo()
? Ui::ReportSource::GroupVideo
: Ui::ReportSource::GroupPhoto)
: (photo->hasVideo()
? Ui::ReportSource::ChannelVideo
: Ui::ReportSource::ChannelPhoto);
}, [](v::null_t) {
Unexpected("Bad source report.");
return Ui::ReportSource::Bot;