mirror of https://github.com/procxx/kepka.git
Prepare code for revoking of full history.
This commit is contained in:
parent
2701e63406
commit
dd8c526fb7
|
@ -2335,7 +2335,7 @@ int ApiWrap::OnlineTillFromStatus(
|
||||||
Unexpected("Bad UserStatus type.");
|
Unexpected("Bad UserStatus type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiWrap::clearHistory(not_null<PeerData*> peer) {
|
void ApiWrap::clearHistory(not_null<PeerData*> peer, bool revoke) {
|
||||||
auto deleteTillId = MsgId(0);
|
auto deleteTillId = MsgId(0);
|
||||||
if (const auto history = _session->data().historyLoaded(peer)) {
|
if (const auto history = _session->data().historyLoaded(peer)) {
|
||||||
if (const auto last = history->lastMessage()) {
|
if (const auto last = history->lastMessage()) {
|
||||||
|
@ -2349,7 +2349,7 @@ void ApiWrap::clearHistory(not_null<PeerData*> peer) {
|
||||||
}
|
}
|
||||||
if (const auto channel = peer->asChannel()) {
|
if (const auto channel = peer->asChannel()) {
|
||||||
if (const auto migrated = peer->migrateFrom()) {
|
if (const auto migrated = peer->migrateFrom()) {
|
||||||
clearHistory(migrated);
|
clearHistory(migrated, revoke);
|
||||||
}
|
}
|
||||||
if (IsServerMsgId(deleteTillId)) {
|
if (IsServerMsgId(deleteTillId)) {
|
||||||
request(MTPchannels_DeleteHistory(
|
request(MTPchannels_DeleteHistory(
|
||||||
|
@ -2358,18 +2358,64 @@ void ApiWrap::clearHistory(not_null<PeerData*> peer) {
|
||||||
)).send();
|
)).send();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
deleteHistory(peer, true, revoke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiWrap::deleteConversation(not_null<PeerData*> peer, bool revoke) {
|
||||||
|
if (const auto history = _session->data().historyLoaded(peer->id)) {
|
||||||
|
_session->data().setPinnedDialog(history, false);
|
||||||
|
App::main()->removeDialog(history);
|
||||||
|
history->clear();
|
||||||
|
if (const auto channel = peer->asMegagroup()) {
|
||||||
|
channel->addFlags(MTPDchannel::Flag::f_left);
|
||||||
|
if (const auto from = channel->getMigrateFromChat()) {
|
||||||
|
if (const auto migrated = _session->data().historyLoaded(from)) {
|
||||||
|
migrated->updateChatListExistence();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
history->markFullyLoaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (const auto chat = peer->asChat()) {
|
||||||
|
request(MTPmessages_DeleteChatUser(
|
||||||
|
chat->inputChat,
|
||||||
|
_session->user()->inputUser
|
||||||
|
)).done([=](const MTPUpdates &updates) {
|
||||||
|
applyUpdates(updates);
|
||||||
|
deleteHistory(peer, false, revoke);
|
||||||
|
}).fail([=](const RPCError &error) {
|
||||||
|
deleteHistory(peer, false, revoke);
|
||||||
|
}).send();
|
||||||
|
return;
|
||||||
|
} else if (const auto channel = peer->asChannel()) {
|
||||||
|
channel->ptsWaitingForShortPoll(-1);
|
||||||
|
leaveChannel(channel);
|
||||||
|
} else {
|
||||||
|
deleteHistory(peer, false, revoke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiWrap::deleteHistory(not_null<PeerData*> peer, bool justClear, bool revoke) {
|
||||||
|
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));
|
||||||
request(MTPmessages_DeleteHistory(
|
request(MTPmessages_DeleteHistory(
|
||||||
MTP_flags(MTPmessages_DeleteHistory::Flag::f_just_clear),
|
MTP_flags(flags),
|
||||||
peer->input,
|
peer->input,
|
||||||
MTP_int(0)
|
MTP_int(0)
|
||||||
)).done([=](const MTPmessages_AffectedHistory &result) {
|
)).done([=](const MTPmessages_AffectedHistory &result) {
|
||||||
const auto offset = applyAffectedHistory(peer, result);
|
const auto offset = applyAffectedHistory(peer, result);
|
||||||
if (offset > 0) {
|
if (offset > 0) {
|
||||||
clearHistory(peer);
|
deleteHistory(peer, justClear, revoke);
|
||||||
|
} else if (!justClear && cReportSpamStatuses().contains(peer->id)) {
|
||||||
|
cRefReportSpamStatuses().remove(peer->id);
|
||||||
|
Local::writeReportSpamStatuses();
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int ApiWrap::applyAffectedHistory(
|
int ApiWrap::applyAffectedHistory(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
|
|
|
@ -211,7 +211,8 @@ public:
|
||||||
const MTPUserStatus &status,
|
const MTPUserStatus &status,
|
||||||
int currentOnlineTill);
|
int currentOnlineTill);
|
||||||
|
|
||||||
void clearHistory(not_null<PeerData*> peer);
|
void clearHistory(not_null<PeerData*> peer, bool revoke);
|
||||||
|
void deleteConversation(not_null<PeerData*> peer, bool revoke);
|
||||||
|
|
||||||
base::Observable<PeerData*> &fullPeerUpdated() {
|
base::Observable<PeerData*> &fullPeerUpdated() {
|
||||||
return _fullPeerUpdated;
|
return _fullPeerUpdated;
|
||||||
|
@ -540,6 +541,10 @@ private:
|
||||||
UserId userId,
|
UserId userId,
|
||||||
const SendOptions &options);
|
const SendOptions &options);
|
||||||
|
|
||||||
|
void deleteHistory(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
bool justClear,
|
||||||
|
bool revoke);
|
||||||
void sendReadRequest(not_null<PeerData*> peer, MsgId upTo);
|
void sendReadRequest(not_null<PeerData*> peer, MsgId upTo);
|
||||||
int applyAffectedHistory(
|
int applyAffectedHistory(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
|
|
|
@ -151,6 +151,7 @@ public:
|
||||||
not_null<HistoryItem*> item,
|
not_null<HistoryItem*> item,
|
||||||
bool suggestModerateActions);
|
bool suggestModerateActions);
|
||||||
DeleteMessagesBox(QWidget*, MessageIdsList &&selected);
|
DeleteMessagesBox(QWidget*, MessageIdsList &&selected);
|
||||||
|
DeleteMessagesBox(QWidget*, not_null<PeerData*> peer, bool deleteChat);
|
||||||
|
|
||||||
void setDeleteConfirmedCallback(Fn<void()> callback) {
|
void setDeleteConfirmedCallback(Fn<void()> callback) {
|
||||||
_deleteConfirmedCallback = std::move(callback);
|
_deleteConfirmedCallback = std::move(callback);
|
||||||
|
|
|
@ -1109,7 +1109,7 @@ void Controller::deleteChannel() {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
Ui::showChatsList();
|
Ui::showChatsList();
|
||||||
if (chat) {
|
if (chat) {
|
||||||
App::main()->deleteAndExit(chat);
|
chat->session().api().deleteConversation(chat, false);
|
||||||
}
|
}
|
||||||
MTP::send(
|
MTP::send(
|
||||||
MTPchannels_DeleteChannel(channel->inputChannel),
|
MTPchannels_DeleteChannel(channel->inputChannel),
|
||||||
|
|
|
@ -2411,7 +2411,7 @@ void History::dialogEntryApplied() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
App::main()->deleteConversation(peer, false);
|
clear();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4473,16 +4473,11 @@ void HistoryWidget::onReportSpamClear() {
|
||||||
Expects(_peer != nullptr);
|
Expects(_peer != nullptr);
|
||||||
|
|
||||||
InvokeQueued(App::main(), [peer = _peer] {
|
InvokeQueued(App::main(), [peer = _peer] {
|
||||||
if (peer->isUser()) {
|
Ui::showChatsList();
|
||||||
App::main()->deleteConversation(peer);
|
if (const auto from = peer->migrateFrom()) {
|
||||||
} else if (auto chat = peer->asChat()) {
|
peer->session().api().deleteConversation(from, false);
|
||||||
App::main()->deleteAndExit(chat);
|
|
||||||
} else if (auto channel = peer->asChannel()) {
|
|
||||||
if (channel->migrateFrom()) {
|
|
||||||
App::main()->deleteConversation(channel->migrateFrom());
|
|
||||||
}
|
|
||||||
Auth().api().leaveChannel(channel);
|
|
||||||
}
|
}
|
||||||
|
peer->session().api().deleteConversation(peer, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Invalidates _peer.
|
// Invalidates _peer.
|
||||||
|
|
|
@ -899,45 +899,6 @@ void MainWidget::dialogsActivate() {
|
||||||
_dialogs->activate();
|
_dialogs->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWidget::leaveChatFailed(PeerData *peer, const RPCError &error) {
|
|
||||||
if (MTP::isDefaultHandledError(error)) return false;
|
|
||||||
|
|
||||||
if (error.type() == qstr("USER_NOT_PARTICIPANT") || error.type() == qstr("CHAT_ID_INVALID") || error.type() == qstr("PEER_ID_INVALID")) { // left this chat already
|
|
||||||
deleteConversation(peer);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWidget::deleteHistoryAfterLeave(PeerData *peer, const MTPUpdates &updates) {
|
|
||||||
sentUpdatesReceived(updates);
|
|
||||||
deleteConversation(peer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWidget::deleteHistoryPart(DeleteHistoryRequest request, const MTPmessages_AffectedHistory &result) {
|
|
||||||
auto peer = request.peer;
|
|
||||||
|
|
||||||
auto &d = result.c_messages_affectedHistory();
|
|
||||||
if (peer && peer->isChannel()) {
|
|
||||||
peer->asChannel()->ptsUpdateAndApply(d.vpts.v, d.vpts_count.v);
|
|
||||||
} else {
|
|
||||||
ptsUpdateAndApply(d.vpts.v, d.vpts_count.v);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto offset = d.voffset.v;
|
|
||||||
if (offset <= 0) {
|
|
||||||
cRefReportSpamStatuses().remove(peer->id);
|
|
||||||
Local::writeReportSpamStatuses();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto flags = MTPmessages_DeleteHistory::Flags(0);
|
|
||||||
if (request.justClearHistory) {
|
|
||||||
flags |= MTPmessages_DeleteHistory::Flag::f_just_clear;
|
|
||||||
}
|
|
||||||
MTP::send(MTPmessages_DeleteHistory(MTP_flags(flags), peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, request));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWidget::deleteMessages(
|
void MainWidget::deleteMessages(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const QVector<MTPint> &ids,
|
const QVector<MTPint> &ids,
|
||||||
|
@ -958,62 +919,10 @@ void MainWidget::deleteMessages(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::deletedContact(UserData *user, const MTPcontacts_Link &result) {
|
|
||||||
auto &d(result.c_contacts_link());
|
|
||||||
session().data().processUsers(MTP_vector<MTPUser>(1, d.vuser));
|
|
||||||
App::feedUserLink(MTP_int(peerToUser(user->id)), d.vmy_link, d.vforeign_link);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWidget::removeDialog(Dialogs::Key key) {
|
void MainWidget::removeDialog(Dialogs::Key key) {
|
||||||
_dialogs->removeDialog(key);
|
_dialogs->removeDialog(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::deleteConversation(
|
|
||||||
not_null<PeerData*> peer,
|
|
||||||
bool deleteHistory) {
|
|
||||||
if (_controller->activeChatCurrent().peer() == peer) {
|
|
||||||
Ui::showChatsList();
|
|
||||||
}
|
|
||||||
if (const auto history = session().data().historyLoaded(peer->id)) {
|
|
||||||
session().data().setPinnedDialog(history, false);
|
|
||||||
removeDialog(history);
|
|
||||||
if (const auto channel = peer->asMegagroup()) {
|
|
||||||
channel->addFlags(MTPDchannel::Flag::f_left);
|
|
||||||
if (const auto from = channel->getMigrateFromChat()) {
|
|
||||||
if (const auto migrated = session().data().historyLoaded(from)) {
|
|
||||||
migrated->updateChatListExistence();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
history->clear();
|
|
||||||
if (deleteHistory) {
|
|
||||||
history->markFullyLoaded();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (const auto channel = peer->asChannel()) {
|
|
||||||
channel->ptsWaitingForShortPoll(-1);
|
|
||||||
}
|
|
||||||
if (deleteHistory) {
|
|
||||||
DeleteHistoryRequest request = { peer, false };
|
|
||||||
MTP::send(
|
|
||||||
MTPmessages_DeleteHistory(
|
|
||||||
MTP_flags(0),
|
|
||||||
peer->input,
|
|
||||||
MTP_int(0)),
|
|
||||||
rpcDone(&MainWidget::deleteHistoryPart, request));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWidget::deleteAndExit(ChatData *chat) {
|
|
||||||
PeerData *peer = chat;
|
|
||||||
MTP::send(
|
|
||||||
MTPmessages_DeleteChatUser(
|
|
||||||
chat->inputChat,
|
|
||||||
session().user()->inputUser),
|
|
||||||
rpcDone(&MainWidget::deleteHistoryAfterLeave, peer),
|
|
||||||
rpcFail(&MainWidget::leaveChatFailed, peer));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MainWidget::sendMessageFail(const RPCError &error) {
|
bool MainWidget::sendMessageFail(const RPCError &error) {
|
||||||
if (MTP::isDefaultHandledError(error)) return false;
|
if (MTP::isDefaultHandledError(error)) return false;
|
||||||
|
|
||||||
|
|
|
@ -195,17 +195,10 @@ public:
|
||||||
|
|
||||||
void deletePhotoLayer(PhotoData *photo);
|
void deletePhotoLayer(PhotoData *photo);
|
||||||
|
|
||||||
bool leaveChatFailed(PeerData *peer, const RPCError &e);
|
|
||||||
void deleteHistoryAfterLeave(PeerData *peer, const MTPUpdates &updates);
|
|
||||||
void deleteMessages(
|
void deleteMessages(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const QVector<MTPint> &ids,
|
const QVector<MTPint> &ids,
|
||||||
bool revoke);
|
bool revoke);
|
||||||
void deletedContact(UserData *user, const MTPcontacts_Link &result);
|
|
||||||
void deleteConversation(
|
|
||||||
not_null<PeerData*> peer,
|
|
||||||
bool deleteHistory = true);
|
|
||||||
void deleteAndExit(ChatData *chat);
|
|
||||||
|
|
||||||
bool sendMessageFail(const RPCError &error);
|
bool sendMessageFail(const RPCError &error);
|
||||||
|
|
||||||
|
@ -416,8 +409,6 @@ private:
|
||||||
// Doesn't call sendHistoryChangeNotifications itself.
|
// Doesn't call sendHistoryChangeNotifications itself.
|
||||||
void feedUpdate(const MTPUpdate &update);
|
void feedUpdate(const MTPUpdate &update);
|
||||||
|
|
||||||
void deleteHistoryPart(DeleteHistoryRequest request, const MTPmessages_AffectedHistory &result);
|
|
||||||
|
|
||||||
void usernameResolveDone(QPair<MsgId, QString> msgIdAndStartToken, const MTPcontacts_ResolvedPeer &result);
|
void usernameResolveDone(QPair<MsgId, QString> msgIdAndStartToken, const MTPcontacts_ResolvedPeer &result);
|
||||||
bool usernameResolveFail(QString name, const RPCError &error);
|
bool usernameResolveFail(QString name, const RPCError &error);
|
||||||
|
|
||||||
|
|
|
@ -570,22 +570,27 @@ void PeerMenuExportChat(not_null<PeerData*> peer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerMenuDeleteContact(not_null<UserData*> user) {
|
void PeerMenuDeleteContact(not_null<UserData*> user) {
|
||||||
auto text = lng_sure_delete_contact(
|
const auto text = lng_sure_delete_contact(
|
||||||
lt_contact,
|
lt_contact,
|
||||||
App::peerName(user));
|
App::peerName(user));
|
||||||
auto deleteSure = [=] {
|
const auto deleteSure = [=] {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
MTP::send(
|
user->session().api().request(MTPcontacts_DeleteContact(
|
||||||
MTPcontacts_DeleteContact(user->inputUser),
|
user->inputUser
|
||||||
App::main()->rpcDone(
|
)).done([=](const MTPcontacts_Link &result) {
|
||||||
&MainWidget::deletedContact,
|
result.match([&](const MTPDcontacts_link &data) {
|
||||||
user.get()));
|
user->owner().processUser(data.vuser);
|
||||||
|
App::feedUserLink(
|
||||||
|
MTP_int(peerToUser(user->id)),
|
||||||
|
data.vmy_link,
|
||||||
|
data.vforeign_link);
|
||||||
|
});
|
||||||
|
}).send();
|
||||||
};
|
};
|
||||||
auto box = Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_box_delete),
|
lang(lng_box_delete),
|
||||||
std::move(deleteSure));
|
deleteSure));
|
||||||
Ui::show(std::move(box));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerMenuAddContact(not_null<UserData*> user) {
|
void PeerMenuAddContact(not_null<UserData*> user) {
|
||||||
|
@ -782,32 +787,33 @@ void PeerMenuAddMuteAction(
|
||||||
//}
|
//}
|
||||||
|
|
||||||
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer) {
|
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer) {
|
||||||
return [peer] {
|
return [=] {
|
||||||
const auto weak = std::make_shared<QPointer<ConfirmBox>>();
|
const auto weak = std::make_shared<QPointer<BoxContent>>();
|
||||||
const auto text = peer->isSelf()
|
const auto text = peer->isSelf()
|
||||||
? lang(lng_sure_delete_saved_messages)
|
? lang(lng_sure_delete_saved_messages)
|
||||||
: peer->isUser()
|
: peer->isUser()
|
||||||
? lng_sure_delete_history(lt_contact, peer->name)
|
? lng_sure_delete_history(lt_contact, peer->name)
|
||||||
: lng_sure_delete_group_history(lt_group, peer->name);
|
: lng_sure_delete_group_history(lt_group, peer->name);
|
||||||
auto callback = [=] {
|
const auto callback = [=] {
|
||||||
if (auto strong = *weak) {
|
if (const auto strong = *weak) {
|
||||||
strong->closeBox();
|
strong->closeBox();
|
||||||
}
|
}
|
||||||
Auth().api().clearHistory(peer);
|
peer->session().api().clearHistory(peer, false);
|
||||||
};
|
};
|
||||||
*weak = Ui::show(
|
*weak = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_box_delete),
|
lang(lng_box_delete),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
std::move(callback)),
|
callback),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer) {
|
Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer) {
|
||||||
return [peer] {
|
return [=] {
|
||||||
const auto warningText = peer->isSelf()
|
const auto weak = std::make_shared<QPointer<BoxContent>>();
|
||||||
|
const auto text = peer->isSelf()
|
||||||
? lang(lng_sure_delete_saved_messages)
|
? lang(lng_sure_delete_saved_messages)
|
||||||
: peer->isUser()
|
: peer->isUser()
|
||||||
? lng_sure_delete_history(lt_contact, peer->name)
|
? lng_sure_delete_history(lt_contact, peer->name)
|
||||||
|
@ -816,38 +822,34 @@ Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer) {
|
||||||
: lang(peer->isMegagroup()
|
: lang(peer->isMegagroup()
|
||||||
? lng_sure_leave_group
|
? lng_sure_leave_group
|
||||||
: lng_sure_leave_channel);
|
: lng_sure_leave_channel);
|
||||||
const auto confirmText = lang(peer->isUser()
|
const auto confirm = lang(peer->isUser()
|
||||||
? lng_box_delete
|
? lng_box_delete
|
||||||
: lng_box_leave);
|
: lng_box_leave);
|
||||||
const auto &confirmStyle = peer->isChannel()
|
const auto &confirmStyle = peer->isChannel()
|
||||||
? st::defaultBoxButton
|
? st::defaultBoxButton
|
||||||
: st::attentionBoxButton;
|
: st::attentionBoxButton;
|
||||||
auto callback = [peer] {
|
const auto callback = [=] {
|
||||||
Ui::hideLayer();
|
if (const auto strong = *weak) {
|
||||||
|
strong->closeBox();
|
||||||
|
}
|
||||||
const auto controller = App::wnd()->controller();
|
const auto controller = App::wnd()->controller();
|
||||||
if (controller->activeChatCurrent().peer() == peer) {
|
if (controller->activeChatCurrent().peer() == peer) {
|
||||||
Ui::showChatsList();
|
Ui::showChatsList();
|
||||||
}
|
}
|
||||||
if (peer->isUser()) {
|
|
||||||
App::main()->deleteConversation(peer);
|
|
||||||
} else if (const auto chat = peer->asChat()) {
|
|
||||||
App::main()->deleteAndExit(chat);
|
|
||||||
} else if (const auto channel = peer->asChannel()) {
|
|
||||||
// Don't delete old history by default,
|
// Don't delete old history by default,
|
||||||
// because Android app doesn't.
|
// because Android app doesn't.
|
||||||
//
|
//
|
||||||
//if (auto migrateFrom = channel->migrateFrom()) {
|
//if (const auto from = peer->migrateFrom()) {
|
||||||
// App::main()->deleteConversation(migrateFrom);
|
// peer->session().api().deleteConversation(from, false);
|
||||||
//}
|
//}
|
||||||
Auth().api().leaveChannel(channel);
|
peer->session().api().deleteConversation(peer, false);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
Ui::show(
|
*weak = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
warningText,
|
text,
|
||||||
confirmText,
|
confirm,
|
||||||
confirmStyle,
|
confirmStyle,
|
||||||
std::move(callback)),
|
callback),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue