Improved messages delete

Closes #620
This commit is contained in:
Igor Zhukov 2015-01-16 14:43:27 +03:00
parent 859eda650d
commit b9aef94e5a
3 changed files with 15 additions and 3 deletions

View File

@ -1239,9 +1239,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
angular.forEach($scope.selectedMsgs, function (t, messageID) {
selectedMessageIDs.push(messageID);
});
AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () {
selectedCancel();
});
if (selectedMessageIDs.length) {
ErrorService.confirm({type: 'MESSAGES_DELETE', count: selectedMessageIDs.length}).then(function () {
AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () {
selectedCancel();
});
});
}
}
}

View File

@ -132,6 +132,7 @@
"confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?",
"confirm_modal_clipboard_X_files_send": "{'one': 'Are you sure to send file from clipboard?', 'other': 'Are you sure to send {} files from clipboard?'}",
"confirm_modal_message_delete": "Are you sure you want to delete the message?",
"confirm_modal_X_messages_delete": "{'one': 'Are you sure you want to delete the message?', 'other': 'Are you sure you want to delete {} messages?'}",
"confirm_modal_photo_delete": "Are you sure you want to delete the photo?",
"confirm_modal_contacts_import": "Telegram will now sync your contacts in order to find your friends.",
"confirm_modal_login_phone_correct": "Is this phone number correct?",
@ -149,6 +150,7 @@
"confirm_modal_clipboard_files_send_submit": "Send",
"confirm_modal_clipboard_file_send_submit": "Send",
"confirm_modal_message_delete_submit": "Delete",
"confirm_modal_messages_delete_submit": "Delete",
"confirm_modal_photo_delete_submit": "Delete",
"confirm_modal_forward_message_submit": "Forward message",
"confirm_modal_share_photo_submit": "Forward photo",

View File

@ -15,6 +15,11 @@
</span>
<span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send"></span>
<span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete"></span>
<span ng-switch-when="MESSAGES_DELETE">
<ng-pluralize count="count"
when="confirm_modal_X_messages_delete">
</ng-pluralize>
</span>
<span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete"></span>
<span ng-switch-when="CONTACTS_IMPORT_PERFORM" my-i18n="confirm_modal_contacts_import"></span>
<div ng-switch-when="LOGIN_PHONE_CORRECT">
@ -56,6 +61,7 @@
<span ng-switch-when="FILES_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_files_send_submit"></span>
<span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send_submit"></span>
<span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete_submit"></span>
<span ng-switch-when="MESSAGES_DELETE" my-i18n="confirm_modal_messages_delete_submit"></span>
<span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete_submit"></span>
<span ng-switch-when="FORWARD_PEER" my-i18n="confirm_modal_forward_message_submit"></span>
<span ng-switch-when="PHOTO_SHARE_PEER" my-i18n="confirm_modal_share_photo_submit"></span>