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

Don't use MTP* for PeerSettings flags.

This commit is contained in:
John Preston
2021-07-08 17:30:27 +03:00
parent 878c890bc2
commit f22e68fc32
8 changed files with 55 additions and 52 deletions

View File

@@ -834,10 +834,9 @@ void PeerMenuBlockUserBox(
not_null<PeerData*> peer,
std::variant<v::null_t, bool> suggestReport,
std::variant<v::null_t, ClearChat, ClearReply> suggestClear) {
using Flag = MTPDpeerSettings::Flag;
const auto settings = peer->settings().value_or(Flag(0));
const auto settings = peer->settings().value_or(PeerSettings(0));
const auto reportNeeded = v::is_null(suggestReport)
? ((settings & Flag::f_report_spam) != 0)
? ((settings & PeerSetting::ReportSpam) != 0)
: v::get<bool>(suggestReport);
const auto user = peer->asUser();