mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-23 04:13:21 +02:00
fix: restrict saving content toggle
This commit is contained in:
parent
e097a5de58
commit
12879207ef
3 changed files with 6 additions and 5 deletions
|
@ -932,7 +932,7 @@ void Controller::fillPrivacyTypeButton() {
|
||||||
.usernamesOrder = (_peer->isChannel()
|
.usernamesOrder = (_peer->isChannel()
|
||||||
? _peer->asChannel()->usernames()
|
? _peer->asChannel()->usernames()
|
||||||
: std::vector<QString>()),
|
: std::vector<QString>()),
|
||||||
.noForwards = !_peer->allowsForwarding(),
|
.noForwards = _peer->isAyuNoForwards(),
|
||||||
.joinToWrite = (_peer->isMegagroup()
|
.joinToWrite = (_peer->isMegagroup()
|
||||||
&& _peer->asChannel()->joinToWrite()),
|
&& _peer->asChannel()->joinToWrite()),
|
||||||
.requestToJoin = (_peer->isMegagroup()
|
.requestToJoin = (_peer->isMegagroup()
|
||||||
|
@ -2572,7 +2572,7 @@ void Controller::saveSignatures() {
|
||||||
|
|
||||||
void Controller::saveForwards() {
|
void Controller::saveForwards() {
|
||||||
if (!_savingData.noForwards
|
if (!_savingData.noForwards
|
||||||
|| *_savingData.noForwards != _peer->allowsForwarding()) {
|
|| *_savingData.noForwards == _peer->isAyuNoForwards()) {
|
||||||
return continueSave();
|
return continueSave();
|
||||||
}
|
}
|
||||||
_api.request(MTPmessages_ToggleNoForwards(
|
_api.request(MTPmessages_ToggleNoForwards(
|
||||||
|
|
|
@ -1387,7 +1387,7 @@ Data::ForumTopic *PeerData::forumTopicFor(MsgId rootId) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeerData::isAyuNoForwards() const {
|
bool PeerData::isAyuNoForwards() const {
|
||||||
if (const auto user = asUser()) {
|
if (asUser()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (const auto channel = asChannel()) {
|
} else if (const auto channel = asChannel()) {
|
||||||
return channel->isAyuNoForwards();
|
return channel->isAyuNoForwards();
|
||||||
|
@ -1397,7 +1397,6 @@ bool PeerData::isAyuNoForwards() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PeerData::allowsForwarding() const {
|
bool PeerData::allowsForwarding() const {
|
||||||
if (isUser()) {
|
if (isUser()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -850,7 +850,8 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
|
||||||
| Flag::Forbidden
|
| Flag::Forbidden
|
||||||
| Flag::CallActive
|
| Flag::CallActive
|
||||||
| Flag::CallNotEmpty
|
| Flag::CallNotEmpty
|
||||||
| Flag::NoForwards;
|
| Flag::NoForwards
|
||||||
|
| Flag::AyuNoForwards;
|
||||||
const auto flagsSet = (data.is_left() ? Flag::Left : Flag())
|
const auto flagsSet = (data.is_left() ? Flag::Left : Flag())
|
||||||
| (data.is_creator() ? Flag::Creator : Flag())
|
| (data.is_creator() ? Flag::Creator : Flag())
|
||||||
| (data.is_deactivated() ? Flag::Deactivated : Flag())
|
| (data.is_deactivated() ? Flag::Deactivated : Flag())
|
||||||
|
@ -972,6 +973,7 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
|
||||||
| Flag::Forbidden
|
| Flag::Forbidden
|
||||||
| (!minimal ? (Flag::Left | Flag::Creator) : Flag())
|
| (!minimal ? (Flag::Left | Flag::Creator) : Flag())
|
||||||
| Flag::NoForwards
|
| Flag::NoForwards
|
||||||
|
| Flag::AyuNoForwards
|
||||||
| Flag::JoinToWrite
|
| Flag::JoinToWrite
|
||||||
| Flag::RequestToJoin
|
| Flag::RequestToJoin
|
||||||
| Flag::Forum
|
| Flag::Forum
|
||||||
|
|
Loading…
Add table
Reference in a new issue