Always return a promise from sendSyncMessage
// FREEBIE
This commit is contained in:
parent
acae4afce3
commit
e9949152bb
2 changed files with 30 additions and 26 deletions
|
@ -37404,7 +37404,10 @@ MessageSender.prototype = {
|
||||||
sendSyncMessage: function(encodedDataMessage, timestamp, destination) {
|
sendSyncMessage: function(encodedDataMessage, timestamp, destination) {
|
||||||
var myNumber = textsecure.storage.user.getNumber();
|
var myNumber = textsecure.storage.user.getNumber();
|
||||||
var myDevice = textsecure.storage.user.getDeviceId();
|
var myDevice = textsecure.storage.user.getDeviceId();
|
||||||
if (myDevice != 1) {
|
if (myDevice == 1) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
var dataMessage = textsecure.protobuf.DataMessage.decode(encodedDataMessage);
|
var dataMessage = textsecure.protobuf.DataMessage.decode(encodedDataMessage);
|
||||||
var sentMessage = new textsecure.protobuf.SyncMessage.Sent();
|
var sentMessage = new textsecure.protobuf.SyncMessage.Sent();
|
||||||
sentMessage.timestamp = timestamp;
|
sentMessage.timestamp = timestamp;
|
||||||
|
@ -37417,7 +37420,6 @@ MessageSender.prototype = {
|
||||||
var contentMessage = new textsecure.protobuf.Content();
|
var contentMessage = new textsecure.protobuf.Content();
|
||||||
contentMessage.syncMessage = syncMessage;
|
contentMessage.syncMessage = syncMessage;
|
||||||
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
|
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendRequestGroupSyncMessage: function() {
|
sendRequestGroupSyncMessage: function() {
|
||||||
|
|
|
@ -69,7 +69,10 @@ MessageSender.prototype = {
|
||||||
sendSyncMessage: function(encodedDataMessage, timestamp, destination) {
|
sendSyncMessage: function(encodedDataMessage, timestamp, destination) {
|
||||||
var myNumber = textsecure.storage.user.getNumber();
|
var myNumber = textsecure.storage.user.getNumber();
|
||||||
var myDevice = textsecure.storage.user.getDeviceId();
|
var myDevice = textsecure.storage.user.getDeviceId();
|
||||||
if (myDevice != 1) {
|
if (myDevice == 1) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
var dataMessage = textsecure.protobuf.DataMessage.decode(encodedDataMessage);
|
var dataMessage = textsecure.protobuf.DataMessage.decode(encodedDataMessage);
|
||||||
var sentMessage = new textsecure.protobuf.SyncMessage.Sent();
|
var sentMessage = new textsecure.protobuf.SyncMessage.Sent();
|
||||||
sentMessage.timestamp = timestamp;
|
sentMessage.timestamp = timestamp;
|
||||||
|
@ -82,7 +85,6 @@ MessageSender.prototype = {
|
||||||
var contentMessage = new textsecure.protobuf.Content();
|
var contentMessage = new textsecure.protobuf.Content();
|
||||||
contentMessage.syncMessage = syncMessage;
|
contentMessage.syncMessage = syncMessage;
|
||||||
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
|
return this.sendIndividualProto(myNumber, contentMessage, Date.now());
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendRequestGroupSyncMessage: function() {
|
sendRequestGroupSyncMessage: function() {
|
||||||
|
|
Loading…
Reference in a new issue