mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Allow clear history for everyone in small supergroups.
This commit is contained in:
parent
14d525dade
commit
4896509ddf
2 changed files with 5 additions and 4 deletions
|
@ -748,8 +748,6 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||||
tr::now,
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName);
|
user->firstName);
|
||||||
} else if (_wipeHistoryJustClear) {
|
|
||||||
return std::nullopt;
|
|
||||||
} else {
|
} else {
|
||||||
result.checkbox = tr::lng_delete_for_everyone_check(tr::now);
|
result.checkbox = tr::lng_delete_for_everyone_check(tr::now);
|
||||||
}
|
}
|
||||||
|
|
|
@ -595,7 +595,7 @@ void Histories::deleteAllMessages(
|
||||||
};
|
};
|
||||||
const auto chat = peer->asChat();
|
const auto chat = peer->asChat();
|
||||||
const auto channel = peer->asChannel();
|
const auto channel = peer->asChannel();
|
||||||
if (revoke && channel && channel->canDelete()) {
|
if (!justClear && revoke && channel && channel->canDelete()) {
|
||||||
return session().api().request(MTPchannels_DeleteChannel(
|
return session().api().request(MTPchannels_DeleteChannel(
|
||||||
channel->inputChannel
|
channel->inputChannel
|
||||||
)).done([=](const MTPUpdates &result) {
|
)).done([=](const MTPUpdates &result) {
|
||||||
|
@ -606,8 +606,11 @@ void Histories::deleteAllMessages(
|
||||||
// }
|
// }
|
||||||
}).send();
|
}).send();
|
||||||
} else if (channel) {
|
} else if (channel) {
|
||||||
|
const auto flags = revoke
|
||||||
|
? MTPchannels_DeleteHistory::Flag::f_for_everyone
|
||||||
|
: MTPchannels_DeleteHistory::Flag(0);
|
||||||
return session().api().request(MTPchannels_DeleteHistory(
|
return session().api().request(MTPchannels_DeleteHistory(
|
||||||
MTP_flags(0),
|
MTP_flags(flags),
|
||||||
channel->inputChannel,
|
channel->inputChannel,
|
||||||
MTP_int(deleteTillId)
|
MTP_int(deleteTillId)
|
||||||
)).done([=](const MTPBool &result) {
|
)).done([=](const MTPBool &result) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue