2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2017-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2018-07-21 21:51:20 +00:00
|
|
|
/* global window, textsecure */
|
2017-07-17 22:46:00 +00:00
|
|
|
|
2018-07-21 21:51:20 +00:00
|
|
|
// eslint-disable-next-line func-names
|
2020-11-18 15:15:42 +00:00
|
|
|
(function () {
|
2018-07-21 21:51:20 +00:00
|
|
|
/** ***************************************
|
2018-05-02 16:51:22 +00:00
|
|
|
*** Not-yet-processed message storage ***
|
2018-07-21 21:51:20 +00:00
|
|
|
**************************************** */
|
2018-05-02 16:51:22 +00:00
|
|
|
window.textsecure = window.textsecure || {};
|
|
|
|
window.textsecure.storage = window.textsecure.storage || {};
|
2017-07-17 22:46:00 +00:00
|
|
|
|
2018-05-02 16:51:22 +00:00
|
|
|
window.textsecure.storage.unprocessed = {
|
2018-09-28 22:51:26 +00:00
|
|
|
getCount() {
|
|
|
|
return textsecure.storage.protocol.getUnprocessedCount();
|
|
|
|
},
|
2018-07-21 21:51:20 +00:00
|
|
|
getAll() {
|
2018-05-02 16:51:22 +00:00
|
|
|
return textsecure.storage.protocol.getAllUnprocessed();
|
|
|
|
},
|
2018-08-10 00:28:51 +00:00
|
|
|
get(id) {
|
|
|
|
return textsecure.storage.protocol.getUnprocessedById(id);
|
|
|
|
},
|
2019-02-05 01:23:50 +00:00
|
|
|
updateAttempts(id, attempts) {
|
|
|
|
return textsecure.storage.protocol.updateUnprocessedAttempts(
|
|
|
|
id,
|
|
|
|
attempts
|
|
|
|
);
|
|
|
|
},
|
|
|
|
addDecryptedData(id, data) {
|
|
|
|
return textsecure.storage.protocol.updateUnprocessedWithData(id, data);
|
2018-05-02 16:51:22 +00:00
|
|
|
},
|
2019-09-26 19:56:31 +00:00
|
|
|
addDecryptedDataToList(array) {
|
|
|
|
return textsecure.storage.protocol.updateUnprocessedsWithData(array);
|
|
|
|
},
|
|
|
|
remove(idOrArray) {
|
|
|
|
return textsecure.storage.protocol.removeUnprocessed(idOrArray);
|
2018-05-02 16:51:22 +00:00
|
|
|
},
|
2018-09-28 22:51:26 +00:00
|
|
|
removeAll() {
|
|
|
|
return textsecure.storage.protocol.removeAllUnprocessed();
|
|
|
|
},
|
2018-05-02 16:51:22 +00:00
|
|
|
};
|
2017-07-17 22:46:00 +00:00
|
|
|
})();
|