Move group storage into window.axolotl

This commit is contained in:
Matt Corallo 2015-01-14 13:42:01 -10:00 committed by lilia
parent 83c6fe9008
commit 849fdb7ae4
5 changed files with 55 additions and 21 deletions

View 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);
},
},
};
})();