mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +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,
|
||||
{ user->firstName },
|
||||
Ui::Text::RichLangValue);
|
||||
} else if (_wipeHistoryJustClear) {
|
||||
return std::nullopt;
|
||||
} else {
|
||||
result.checkbox.text = tr::lng_delete_for_everyone_check(tr::now);
|
||||
}
|
||||
|
|
|
@ -641,8 +641,9 @@ void Histories::deleteAllMessages(
|
|||
// }
|
||||
}).send();
|
||||
} else if (channel) {
|
||||
using Flag = MTPchannels_DeleteHistory::Flag;
|
||||
return session().api().request(MTPchannels_DeleteHistory(
|
||||
MTP_flags(0),
|
||||
MTP_flags(revoke ? Flag::f_for_everyone : Flag(0)),
|
||||
channel->inputChannel,
|
||||
MTP_int(deleteTillId)
|
||||
)).done(finish).fail(finish).send();
|
||||
|
|
|
@ -903,9 +903,7 @@ bool PeerData::canRevokeFullHistory() const {
|
|||
} else if (const auto chat = asChat()) {
|
||||
return chat->amCreator();
|
||||
} else if (const auto megagroup = asMegagroup()) {
|
||||
return megagroup->amCreator()
|
||||
&& megagroup->membersCountKnown()
|
||||
&& megagroup->canDelete();
|
||||
return megagroup->amCreator();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue