Reject messages sent to groups with no members
If you're the last member of the group, it doesn't make sense to send messages to it. Previously, we would wait forever for a callback, causing a stuck pending state indicator. // FREEBIE
This commit is contained in:
parent
4136e3633c
commit
a3d29a92bb
2 changed files with 6 additions and 0 deletions
|
@ -40000,6 +40000,9 @@ MessageSender.prototype = {
|
|||
timestamp = timestamp || Date.now();
|
||||
var me = textsecure.storage.user.getNumber();
|
||||
numbers = numbers.filter(function(number) { return number != me; });
|
||||
if (numbers.length === 0) {
|
||||
return Promise.reject(new Error('No other members in the group'));
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
this.sendMessageProto(timestamp, numbers, proto, function(res) {
|
||||
|
|
|
@ -148,6 +148,9 @@ MessageSender.prototype = {
|
|||
timestamp = timestamp || Date.now();
|
||||
var me = textsecure.storage.user.getNumber();
|
||||
numbers = numbers.filter(function(number) { return number != me; });
|
||||
if (numbers.length === 0) {
|
||||
return Promise.reject(new Error('No other members in the group'));
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
this.sendMessageProto(timestamp, numbers, proto, function(res) {
|
||||
|
|
Loading…
Reference in a new issue