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
|
|
|
|
(function() {
|
|
|
|
/** ***************************************
|
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);
|
|
|
|
},
|
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-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
|
|
|
},
|
2018-07-21 21:51:20 +00:00
|
|
|
remove(id) {
|
2018-05-02 16:51:22 +00:00
|
|
|
return textsecure.storage.protocol.removeUnprocessed(id);
|
|
|
|
},
|
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
|
|
|
})();
|