Move group storage into window.axolotl
This commit is contained in:
parent
83c6fe9008
commit
849fdb7ae4
5 changed files with 55 additions and 21 deletions
26
libtextsecure/axolotl_wrapper.js
Normal file
26
libtextsecure/axolotl_wrapper.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
//TODO: Remove almost everything here...
|
||||
|
||||
'use strict';
|
||||
|
||||
;(function() {
|
||||
window.axolotl = window.axolotl || {};
|
||||
window.axolotl.api = {
|
||||
getMyIdentifier: function() {
|
||||
return textsecure.utils.unencodeNumber(textsecure.storage.getUnencrypted("number_id"))[0];
|
||||
},
|
||||
isIdentifierSane: function(identifier) {
|
||||
return textsecure.utils.isNumberSane(identifier);
|
||||
},
|
||||
storage: {
|
||||
put: function(key, value) {
|
||||
return textsecure.storage.putEncrypted(key, value);
|
||||
},
|
||||
get: function(key, defaultValue) {
|
||||
return textsecure.storage.getEncrypted(key, defaultValue);
|
||||
},
|
||||
remove: function(key) {
|
||||
return textsecure.storage.removeEncrypted(key);
|
||||
},
|
||||
},
|
||||
};
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue