Signal-Desktop/libtextsecure/storage/unprocessed.js

50 lines
1.5 KiB
JavaScript
Raw Normal View History

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 */
2018-07-21 21:51:20 +00:00
// eslint-disable-next-line func-names
(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 || {};
2018-05-02 16:51:22 +00:00
window.textsecure.storage.unprocessed = {
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();
},
get(id) {
return textsecure.storage.protocol.getUnprocessedById(id);
},
2018-07-21 21:51:20 +00:00
add(data) {
2018-05-02 16:51:22 +00:00
return textsecure.storage.protocol.addUnprocessed(data);
},
2019-09-26 19:56:31 +00:00
batchAdd(array) {
return textsecure.storage.protocol.addMultipleUnprocessed(array);
},
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
},
removeAll() {
return textsecure.storage.protocol.removeAllUnprocessed();
},
2018-05-02 16:51:22 +00:00
};
})();