s/\t/ /g in fake_api.js

This commit is contained in:
Matt Corallo 2015-01-06 14:46:23 -08:00
parent 1f8b8cd0ea
commit 28aa0a5508

View file

@ -16,27 +16,27 @@
var getKeysForNumberMap = {};
textsecure.api.getKeysForNumber = function(number, deviceId) {
var res = getKeysForNumberMap[number];
if (res !== undefined) {
delete getKeysForNumberMap[number];
return Promise.resolve(res);
} else
throw new Error("getKeysForNumber of unknown/used number");
var res = getKeysForNumberMap[number];
if (res !== undefined) {
delete getKeysForNumberMap[number];
return Promise.resolve(res);
} else
throw new Error("getKeysForNumber of unknown/used number");
}
var messagesSentMap = {};
textsecure.api.sendMessages = function(destination, messageArray) {
for (i in messageArray) {
var msg = messageArray[i];
if ((msg.type != 1 && msg.type != 3) ||
msg.destinationDeviceId === undefined ||
msg.destinationRegistrationId === undefined ||
msg.body === undefined ||
msg.timestamp == undefined ||
msg.relay !== undefined ||
msg.destination !== undefined)
throw new Error("Invalid message");
for (i in messageArray) {
var msg = messageArray[i];
if ((msg.type != 1 && msg.type != 3) ||
msg.destinationDeviceId === undefined ||
msg.destinationRegistrationId === undefined ||
msg.body === undefined ||
msg.timestamp == undefined ||
msg.relay !== undefined ||
msg.destination !== undefined)
throw new Error("Invalid message");
messagesSentMap[destination + "." + messageArray[i].destinationDeviceId] = msg;
}
messagesSentMap[destination + "." + messageArray[i].destinationDeviceId] = msg;
}
}