Fix issue where group leave failed to send in announcement group.
This commit is contained in:
parent
08008629b3
commit
7c134a6c9d
1 changed files with 6 additions and 6 deletions
|
@ -173,12 +173,6 @@ public final class PushGroupSendJob extends PushSendJob {
|
||||||
throw new MmsException("No GV1 messages can be sent anymore!");
|
throw new MmsException("No GV1 messages can be sent anymore!");
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<GroupDatabase.GroupRecord> groupRecord = DatabaseFactory.getGroupDatabase(context).getGroup(groupRecipient.requireGroupId());
|
|
||||||
|
|
||||||
if (groupRecord.isPresent() && groupRecord.get().isAnnouncementGroup() && !groupRecord.get().isAdmin(Recipient.self())) {
|
|
||||||
throw new MmsException("Non-admins cannot send messages in announcement groups!");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId + ", Attachments: " + buildAttachmentString(message.getAttachments()));
|
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId + ", Attachments: " + buildAttachmentString(message.getAttachments()));
|
||||||
|
|
||||||
|
@ -327,6 +321,12 @@ public final class PushGroupSendJob extends PushSendJob {
|
||||||
throw new UndeliverableMessageException("Messages can no longer be sent to V1 groups!");
|
throw new UndeliverableMessageException("Messages can no longer be sent to V1 groups!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Optional<GroupDatabase.GroupRecord> groupRecord = DatabaseFactory.getGroupDatabase(context).getGroup(groupRecipient.requireGroupId());
|
||||||
|
|
||||||
|
if (groupRecord.isPresent() && groupRecord.get().isAnnouncementGroup() && !groupRecord.get().isAdmin(Recipient.self())) {
|
||||||
|
throw new UndeliverableMessageException("Non-admins cannot send messages in announcement groups!");
|
||||||
|
}
|
||||||
|
|
||||||
SignalServiceDataMessage.Builder builder = SignalServiceDataMessage.newBuilder()
|
SignalServiceDataMessage.Builder builder = SignalServiceDataMessage.newBuilder()
|
||||||
.withTimestamp(message.getSentTimeMillis());
|
.withTimestamp(message.getSentTimeMillis());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue