mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add ability to completely delete legacy group.
This commit is contained in:
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_chat.h"
|
||||
#include "data/data_folder.h"
|
||||
#include "data/data_scheduled_messages.h"
|
||||
#include "main/main_session.h"
|
||||
@@ -599,11 +600,17 @@ void Histories::deleteAllMessages(
|
||||
)).done([=](const MTPBool &result) {
|
||||
finish();
|
||||
}).fail(fail).send();
|
||||
} else if (revoke && peer->isChat() && peer->asChat()->amCreator()) {
|
||||
return session().api().request(MTPmessages_DeleteChat(
|
||||
peer->asChat()->inputChat
|
||||
)).done([=](const MTPBool &result) {
|
||||
finish();
|
||||
}).fail(fail).send();
|
||||
} else {
|
||||
using Flag = MTPmessages_DeleteHistory::Flag;
|
||||
const auto flags = Flag(0)
|
||||
| (justClear ? Flag::f_just_clear : Flag(0))
|
||||
| ((peer->isUser() && revoke) ? Flag::f_revoke : Flag(0));
|
||||
| (revoke ? Flag::f_revoke : Flag(0));
|
||||
return session().api().request(MTPmessages_DeleteHistory(
|
||||
MTP_flags(flags),
|
||||
peer->input,
|
||||
|
@@ -825,6 +825,8 @@ bool PeerData::canRevokeFullHistory() const {
|
||||
&& (!user->isBot() || user->isSupport())
|
||||
&& session().serverConfig().revokePrivateInbox
|
||||
&& (session().serverConfig().revokePrivateTimeLimit == 0x7FFFFFFF);
|
||||
} else if (const auto chat = asChat()) {
|
||||
return chat->amCreator();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user