Eslintify all of libtextsecure

This commit is contained in:
Scott Nonnenberg 2018-07-21 14:51:20 -07:00
parent 4b3f9e969a
commit 0774ba2903
36 changed files with 1960 additions and 2128 deletions

View file

@ -22,17 +22,18 @@ const fakeAPI = {
// sendMessages: fakeCall,
setSignedPreKey: fakeCall,
getKeysForNumber: function(number, deviceId) {
var res = getKeysForNumberMap[number];
getKeysForNumber(number, deviceId) {
const res = getKeysForNumberMap[number];
if (res !== undefined) {
delete getKeysForNumberMap[number];
return Promise.resolve(res);
} else throw new Error('getKeysForNumber of unknown/used number');
}
throw new Error('getKeysForNumber of unknown/used number');
},
sendMessages: function(destination, messageArray) {
sendMessages(destination, messageArray) {
for (i in messageArray) {
var msg = messageArray[i];
const msg = messageArray[i];
if (
(msg.type != 1 && msg.type != 3) ||
msg.destinationDeviceId === undefined ||
@ -45,7 +46,7 @@ const fakeAPI = {
throw new Error('Invalid message');
messagesSentMap[
destination + '.' + messageArray[i].destinationDeviceId
`${destination}.${messageArray[i].destinationDeviceId}`
] = msg;
}
},