Stop sending legacy DataMessages

This commit is contained in:
lilia 2017-02-20 19:51:43 -08:00 committed by Lilia
parent 3fbd1ab618
commit e8548879db
2 changed files with 16 additions and 12 deletions

View file

@ -38681,13 +38681,19 @@ textsecure.MessageReceiver.prototype = {
* vim: ts=4:sw=4:expandtab
*/
function OutgoingMessage(server, timestamp, numbers, message, callback) {
if (message instanceof textsecure.protobuf.DataMessage) {
var content = new textsecure.protobuf.Content();
content.dataMessage = message;
message = content;
}
this.server = server;
this.timestamp = timestamp;
this.numbers = numbers;
this.message = message; // DataMessage or ContentMessage proto
this.message = message; // ContentMessage proto
this.callback = callback;
this.legacy = (message instanceof textsecure.protobuf.DataMessage);
this.numbersCompleted = 0;
this.errors = [];
this.successfulNumbers = [];
@ -38853,11 +38859,7 @@ OutgoingMessage.prototype = {
};
var content = btoa(encryptedMsg.body);
if (this.legacy) {
json.body = content;
} else {
json.content = content;
}
json.content = content;
return json;
},

View file

@ -2,13 +2,19 @@
* vim: ts=4:sw=4:expandtab
*/
function OutgoingMessage(server, timestamp, numbers, message, callback) {
if (message instanceof textsecure.protobuf.DataMessage) {
var content = new textsecure.protobuf.Content();
content.dataMessage = message;
message = content;
}
this.server = server;
this.timestamp = timestamp;
this.numbers = numbers;
this.message = message; // DataMessage or ContentMessage proto
this.message = message; // ContentMessage proto
this.callback = callback;
this.legacy = (message instanceof textsecure.protobuf.DataMessage);
this.numbersCompleted = 0;
this.errors = [];
this.successfulNumbers = [];
@ -174,11 +180,7 @@ OutgoingMessage.prototype = {
};
var content = btoa(encryptedMsg.body);
if (this.legacy) {
json.body = content;
} else {
json.content = content;
}
json.content = content;
return json;
},