Single member groups: Make all group-related sends a noop

This commit is contained in:
Scott Nonnenberg 2019-03-13 09:19:37 -07:00
parent 42041d955c
commit b83ae11cb3

View file

@ -908,7 +908,12 @@ MessageSender.prototype = {
const me = textsecure.storage.user.getNumber(); const me = textsecure.storage.user.getNumber();
const numbers = groupNumbers.filter(number => number !== me); const numbers = groupNumbers.filter(number => number !== me);
if (numbers.length === 0) { if (numbers.length === 0) {
return Promise.reject(new Error('No other members in the group')); return Promise.resolve({
successfulNumbers: [],
failoverNumbers: [],
errors: [],
unidentifiedDeliveries: [],
});
} }
return this.sendMessage( return this.sendMessage(
@ -1022,8 +1027,14 @@ MessageSender.prototype = {
const me = textsecure.storage.user.getNumber(); const me = textsecure.storage.user.getNumber();
const numbers = groupNumbers.filter(number => number !== me); const numbers = groupNumbers.filter(number => number !== me);
if (numbers.length === 0) { if (numbers.length === 0) {
return Promise.reject(new Error('No other members in the group')); return Promise.resolve({
successfulNumbers: [],
failoverNumbers: [],
errors: [],
unidentifiedDeliveries: [],
});
} }
return this.sendMessage( return this.sendMessage(
{ {
recipients: numbers, recipients: numbers,