Eslintify all of libtextsecure
This commit is contained in:
parent
4b3f9e969a
commit
0774ba2903
36 changed files with 1960 additions and 2128 deletions
|
@ -1,33 +1,34 @@
|
|||
'use strict';
|
||||
/* global textsecure, window */
|
||||
|
||||
// eslint-disable-next-line func-names
|
||||
(function() {
|
||||
/*********************************************
|
||||
/** *******************************************
|
||||
*** Utilities to store data about the user ***
|
||||
**********************************************/
|
||||
********************************************* */
|
||||
window.textsecure = window.textsecure || {};
|
||||
window.textsecure.storage = window.textsecure.storage || {};
|
||||
|
||||
window.textsecure.storage.user = {
|
||||
setNumberAndDeviceId: function(number, deviceId, deviceName) {
|
||||
textsecure.storage.put('number_id', number + '.' + deviceId);
|
||||
setNumberAndDeviceId(number, deviceId, deviceName) {
|
||||
textsecure.storage.put('number_id', `${number}.${deviceId}`);
|
||||
if (deviceName) {
|
||||
textsecure.storage.put('device_name', deviceName);
|
||||
}
|
||||
},
|
||||
|
||||
getNumber: function(key, defaultValue) {
|
||||
var number_id = textsecure.storage.get('number_id');
|
||||
if (number_id === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(number_id)[0];
|
||||
getNumber() {
|
||||
const numberId = textsecure.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(numberId)[0];
|
||||
},
|
||||
|
||||
getDeviceId: function(key) {
|
||||
var number_id = textsecure.storage.get('number_id');
|
||||
if (number_id === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(number_id)[1];
|
||||
getDeviceId() {
|
||||
const numberId = textsecure.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(numberId)[1];
|
||||
},
|
||||
|
||||
getDeviceName: function(key) {
|
||||
getDeviceName() {
|
||||
return textsecure.storage.get('device_name');
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue