mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Allow clearing history in megagroups.
This commit is contained in:
parent
29c61635de
commit
ff51bf81f3
3 changed files with 3 additions and 6 deletions
|
@ -337,8 +337,6 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||||
lt_user,
|
lt_user,
|
||||||
{ user->firstName },
|
{ user->firstName },
|
||||||
Ui::Text::RichLangValue);
|
Ui::Text::RichLangValue);
|
||||||
} else if (_wipeHistoryJustClear) {
|
|
||||||
return std::nullopt;
|
|
||||||
} else {
|
} else {
|
||||||
result.checkbox.text = tr::lng_delete_for_everyone_check(tr::now);
|
result.checkbox.text = tr::lng_delete_for_everyone_check(tr::now);
|
||||||
}
|
}
|
||||||
|
|
|
@ -641,8 +641,9 @@ void Histories::deleteAllMessages(
|
||||||
// }
|
// }
|
||||||
}).send();
|
}).send();
|
||||||
} else if (channel) {
|
} else if (channel) {
|
||||||
|
using Flag = MTPchannels_DeleteHistory::Flag;
|
||||||
return session().api().request(MTPchannels_DeleteHistory(
|
return session().api().request(MTPchannels_DeleteHistory(
|
||||||
MTP_flags(0),
|
MTP_flags(revoke ? Flag::f_for_everyone : Flag(0)),
|
||||||
channel->inputChannel,
|
channel->inputChannel,
|
||||||
MTP_int(deleteTillId)
|
MTP_int(deleteTillId)
|
||||||
)).done(finish).fail(finish).send();
|
)).done(finish).fail(finish).send();
|
||||||
|
|
|
@ -903,9 +903,7 @@ bool PeerData::canRevokeFullHistory() const {
|
||||||
} else if (const auto chat = asChat()) {
|
} else if (const auto chat = asChat()) {
|
||||||
return chat->amCreator();
|
return chat->amCreator();
|
||||||
} else if (const auto megagroup = asMegagroup()) {
|
} else if (const auto megagroup = asMegagroup()) {
|
||||||
return megagroup->amCreator()
|
return megagroup->amCreator();
|
||||||
&& megagroup->membersCountKnown()
|
|
||||||
&& megagroup->canDelete();
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue