2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use separate phrases for clearing saved messages.

This commit is contained in:
John Preston
2017-12-06 18:39:27 +04:00
parent c6d3fd883a
commit 775cede16f
7 changed files with 86 additions and 84 deletions

View File

@@ -453,53 +453,20 @@ void ActionsFiller::addDeleteContactAction(
}
void ActionsFiller::addClearHistoryAction(not_null<UserData*> user) {
auto callback = [user] {
auto confirmation = lng_sure_delete_history(
lt_contact,
App::peerName(user));
auto confirmCallback = [user] {
Ui::hideLayer();
Auth().api().clearHistory(user);
Ui::showPeerHistory(user, ShowAtUnreadMsgId);
};
auto box = Box<ConfirmBox>(
confirmation,
lang(lng_box_delete),
st::attentionBoxButton,
std::move(confirmCallback));
Ui::show(std::move(box));
};
AddActionButton(
_wrap,
Lang::Viewer(lng_profile_clear_history),
rpl::single(true),
std::move(callback));
Window::ClearHistoryHandler(user));
}
void ActionsFiller::addDeleteConversationAction(
not_null<UserData*> user) {
auto callback = [user] {
auto confirmation = lng_sure_delete_history(
lt_contact,
App::peerName(user));
auto confirmButton = lang(lng_box_delete);
auto confirmCallback = [user] {
Ui::hideLayer();
Ui::showChatsList();
App::main()->deleteConversation(user);
};
auto box = Box<ConfirmBox>(
confirmation,
confirmButton,
st::attentionBoxButton,
std::move(confirmCallback));
Ui::show(std::move(box));
};
AddActionButton(
_wrap,
Lang::Viewer(lng_profile_delete_conversation),
rpl::single(true),
std::move(callback));
Window::DeleteAndLeaveHandler(user));
}
void ActionsFiller::addBotCommandActions(not_null<UserData*> user) {