mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 20:18:34 +00:00
Allow sending of group v2 updates to inactive groups.
This commit is contained in:
parent
833ca8cce9
commit
6d035c6888
@ -108,14 +108,14 @@ public class PushGroupSendJob extends PushSendJob {
|
|||||||
throw new AssertionError("Not a group!");
|
throw new AssertionError("Not a group!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DatabaseFactory.getGroupDatabase(context).isActive(group.requireGroupId())) {
|
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
||||||
|
OutgoingMediaMessage message = database.getOutgoingMessage(messageId);
|
||||||
|
Set<String> attachmentUploadIds = enqueueCompressingAndUploadAttachmentsChains(jobManager, message);
|
||||||
|
|
||||||
|
if (!DatabaseFactory.getGroupDatabase(context).isActive(group.requireGroupId()) && !isGv2UpdateMessage(message)) {
|
||||||
throw new MmsException("Inactive group!");
|
throw new MmsException("Inactive group!");
|
||||||
}
|
}
|
||||||
|
|
||||||
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
|
||||||
OutgoingMediaMessage message = database.getOutgoingMessage(messageId);
|
|
||||||
Set<String> attachmentUploadIds = enqueueCompressingAndUploadAttachmentsChains(jobManager, message);
|
|
||||||
|
|
||||||
jobManager.add(new PushGroupSendJob(messageId, destination, filterAddress, !attachmentUploadIds.isEmpty()), attachmentUploadIds, attachmentUploadIds.isEmpty() ? null : destination.toQueueKey());
|
jobManager.add(new PushGroupSendJob(messageId, destination, filterAddress, !attachmentUploadIds.isEmpty()), attachmentUploadIds, attachmentUploadIds.isEmpty() ? null : destination.toQueueKey());
|
||||||
|
|
||||||
} catch (NoSuchMessageException | MmsException e) {
|
} catch (NoSuchMessageException | MmsException e) {
|
||||||
@ -132,6 +132,10 @@ public class PushGroupSendJob extends PushSendJob {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isGv2UpdateMessage(@NonNull OutgoingMediaMessage message) {
|
||||||
|
return (message instanceof OutgoingGroupUpdateMessage && ((OutgoingGroupUpdateMessage) message).isV2Group());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull String getFactoryKey() {
|
public @NonNull String getFactoryKey() {
|
||||||
return KEY;
|
return KEY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user