2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +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

@@ -60,10 +60,9 @@ void SendRequest(
user->username);
user->session().api().applyUpdates(result);
if (const auto settings = user->settings()) {
using Flag = MTPDpeerSettings::Flag;
const auto flags = Flag::f_add_contact
| Flag::f_block_contact
| Flag::f_report_spam;
const auto flags = PeerSetting::AddContact
| PeerSetting::BlockContact
| PeerSetting::ReportSpam;
user->setSettings(*settings & ~flags);
}
if (box) {
@@ -241,9 +240,8 @@ void Controller::setupWarning() {
void Controller::setupSharePhoneNumber() {
const auto settings = _user->settings();
using Setting = MTPDpeerSettings::Flag;
if (!settings
|| !((*settings) & Setting::f_need_contacts_exception)) {
|| !((*settings) & PeerSetting::NeedContactsException)) {
return;
}
_sharePhone = _box->addRow(