mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Change return type from sending messages
Pass the whole result from the outgoing message callback on to the caller, and preserve the names of the members. // FREEBIE
This commit is contained in:
@@ -37110,7 +37110,7 @@ OutgoingMessage.prototype = {
|
||||
numberCompleted: function() {
|
||||
this.numbersCompleted++;
|
||||
if (this.numbersCompleted >= this.numbers.length) {
|
||||
this.callback({success: this.successfulNumbers, failure: this.errors});
|
||||
this.callback({successfulNumbers: this.successfulNumbers, errors: this.errors});
|
||||
}
|
||||
},
|
||||
registerError: function(number, reason, error) {
|
||||
@@ -37326,10 +37326,10 @@ MessageSender.prototype = {
|
||||
sendIndividualProto: function(number, proto, timestamp) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
this.sendMessageProto(timestamp, [number], proto, function(res) {
|
||||
if (res.failure.length > 0)
|
||||
reject(res.failure);
|
||||
if (res.errors.length > 0)
|
||||
reject(res);
|
||||
else
|
||||
resolve();
|
||||
resolve(res);
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
@@ -37393,10 +37393,10 @@ MessageSender.prototype = {
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
this.sendMessageProto(timestamp, numbers, proto, function(res) {
|
||||
if (res.failure.length > 0)
|
||||
reject(res.failure);
|
||||
if (res.errors.length > 0)
|
||||
reject(res);
|
||||
else
|
||||
resolve();
|
||||
resolve(res);
|
||||
});
|
||||
}.bind(this)).then(this.sendSyncMessage.bind(this, proto, timestamp));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user