s/\t/ /g in fake_api.js
This commit is contained in:
parent
1f8b8cd0ea
commit
28aa0a5508
1 changed files with 18 additions and 18 deletions
|
@ -16,27 +16,27 @@
|
||||||
|
|
||||||
var getKeysForNumberMap = {};
|
var getKeysForNumberMap = {};
|
||||||
textsecure.api.getKeysForNumber = function(number, deviceId) {
|
textsecure.api.getKeysForNumber = function(number, deviceId) {
|
||||||
var res = getKeysForNumberMap[number];
|
var res = getKeysForNumberMap[number];
|
||||||
if (res !== undefined) {
|
if (res !== undefined) {
|
||||||
delete getKeysForNumberMap[number];
|
delete getKeysForNumberMap[number];
|
||||||
return Promise.resolve(res);
|
return Promise.resolve(res);
|
||||||
} else
|
} else
|
||||||
throw new Error("getKeysForNumber of unknown/used number");
|
throw new Error("getKeysForNumber of unknown/used number");
|
||||||
}
|
}
|
||||||
|
|
||||||
var messagesSentMap = {};
|
var messagesSentMap = {};
|
||||||
textsecure.api.sendMessages = function(destination, messageArray) {
|
textsecure.api.sendMessages = function(destination, messageArray) {
|
||||||
for (i in messageArray) {
|
for (i in messageArray) {
|
||||||
var msg = messageArray[i];
|
var msg = messageArray[i];
|
||||||
if ((msg.type != 1 && msg.type != 3) ||
|
if ((msg.type != 1 && msg.type != 3) ||
|
||||||
msg.destinationDeviceId === undefined ||
|
msg.destinationDeviceId === undefined ||
|
||||||
msg.destinationRegistrationId === undefined ||
|
msg.destinationRegistrationId === undefined ||
|
||||||
msg.body === undefined ||
|
msg.body === undefined ||
|
||||||
msg.timestamp == undefined ||
|
msg.timestamp == undefined ||
|
||||||
msg.relay !== undefined ||
|
msg.relay !== undefined ||
|
||||||
msg.destination !== undefined)
|
msg.destination !== undefined)
|
||||||
throw new Error("Invalid message");
|
throw new Error("Invalid message");
|
||||||
|
|
||||||
messagesSentMap[destination + "." + messageArray[i].destinationDeviceId] = msg;
|
messagesSentMap[destination + "." + messageArray[i].destinationDeviceId] = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue