Refactor sendMessageToDevices

Split into separate encrypt and transmit functions. Let the encryption
function also handle all wire formatting (ie, jsonification and base64
encoding), which simplifes TextSecureServer.sendMessages, removes a
TODO, and lets us save fewer params to make network errors replayable.

// FREEBIE
This commit is contained in:
lilia 2015-10-10 15:45:07 -07:00
parent e9bc39bc56
commit 816a206892
4 changed files with 52 additions and 52 deletions

View file

@ -73,10 +73,10 @@
OutgoingMessageError.prototype = new ReplayableError();
OutgoingMessageError.prototype.constructor = OutgoingMessageError;
function SendMessageNetworkError(number, jsonData, legacy, httpError) {
function SendMessageNetworkError(number, jsonData, httpError) {
ReplayableError.call(this, {
functionCode : Type.TRANSMIT_MESSAGE,
args : [number, jsonData, legacy]
args : [number, jsonData]
});
this.name = 'SendMessageNetworkError';
this.number = number;