2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Add revoking of full history.

This commit is contained in:
John Preston
2019-03-21 17:48:40 +04:00
parent 33069739ee
commit eb1825defd
9 changed files with 130 additions and 113 deletions

View File

@@ -899,26 +899,6 @@ void MainWidget::dialogsActivate() {
_dialogs->activate();
}
void MainWidget::deleteMessages(
not_null<PeerData*> peer,
const QVector<MTPint> &ids,
bool revoke) {
if (const auto channel = peer->asChannel()) {
MTP::send(
MTPchannels_DeleteMessages(
channel->inputChannel,
MTP_vector<MTPint>(ids)),
rpcDone(&MainWidget::messagesAffected, peer));
} else {
using Flag = MTPmessages_DeleteMessages::Flag;
MTP::send(
MTPmessages_DeleteMessages(
MTP_flags(revoke ? Flag::f_revoke : Flag(0)),
MTP_vector<MTPint>(ids)),
rpcDone(&MainWidget::messagesAffected, peer));
}
}
void MainWidget::removeDialog(Dialogs::Key key) {
_dialogs->removeDialog(key);
}
@@ -1055,21 +1035,6 @@ void MainWidget::checkLastUpdate(bool afterSleep) {
}
}
void MainWidget::messagesAffected(
not_null<PeerData*> peer,
const MTPmessages_AffectedMessages &result) {
const auto &data = result.c_messages_affectedMessages();
if (const auto channel = peer->asChannel()) {
channel->ptsUpdateAndApply(data.vpts.v, data.vpts_count.v);
} else {
ptsUpdateAndApply(data.vpts.v, data.vpts_count.v);
}
if (const auto history = session().data().historyLoaded(peer)) {
history->requestChatListMessage();
}
}
void MainWidget::handleAudioUpdate(const Media::Player::TrackState &state) {
using State = Media::Player::State;
const auto document = state.id.audio();