mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 08:18:34 +00:00
Fix issue with GV1 avatars using attachmentsV3.
This commit is contained in:
parent
870cee5707
commit
813c820227
@ -94,15 +94,15 @@ public final class AttachmentUploadJob extends BaseJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun() throws Exception {
|
public void onRun() throws Exception {
|
||||||
final ResumableUploadSpec resumableUploadSpec;
|
Data inputData = getInputData();
|
||||||
if (FeatureFlags.attachmentsV3()) {
|
|
||||||
Data inputData = requireInputData();
|
|
||||||
if (!inputData.hasString(ResumableUploadSpecJob.KEY_RESUME_SPEC)) {
|
|
||||||
throw new ResumeLocationInvalidException("V3 Attachment upload requires a ResumableUploadSpec");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ResumableUploadSpec resumableUploadSpec;
|
||||||
|
|
||||||
|
if (inputData != null && inputData.hasString(ResumableUploadSpecJob.KEY_RESUME_SPEC)) {
|
||||||
|
Log.d(TAG, "Using attachments V3");
|
||||||
resumableUploadSpec = ResumableUploadSpec.deserialize(inputData.getString(ResumableUploadSpecJob.KEY_RESUME_SPEC));
|
resumableUploadSpec = ResumableUploadSpec.deserialize(inputData.getString(ResumableUploadSpecJob.KEY_RESUME_SPEC));
|
||||||
} else {
|
} else {
|
||||||
|
Log.d(TAG, "Using attachments V2");
|
||||||
resumableUploadSpec = null;
|
resumableUploadSpec = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,10 +168,16 @@ public abstract class PushSendJob extends SendJob {
|
|||||||
return new HashSet<>(Stream.of(attachments).map(a -> {
|
return new HashSet<>(Stream.of(attachments).map(a -> {
|
||||||
AttachmentUploadJob attachmentUploadJob = new AttachmentUploadJob(((DatabaseAttachment) a).getAttachmentId());
|
AttachmentUploadJob attachmentUploadJob = new AttachmentUploadJob(((DatabaseAttachment) a).getAttachmentId());
|
||||||
|
|
||||||
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
if (message.isGroup()) {
|
||||||
.then(new ResumableUploadSpecJob())
|
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
||||||
.then(attachmentUploadJob)
|
.then(attachmentUploadJob)
|
||||||
.enqueue();
|
.enqueue();
|
||||||
|
} else {
|
||||||
|
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
||||||
|
.then(new ResumableUploadSpecJob())
|
||||||
|
.then(attachmentUploadJob)
|
||||||
|
.enqueue();
|
||||||
|
}
|
||||||
|
|
||||||
return attachmentUploadJob.getId();
|
return attachmentUploadJob.getId();
|
||||||
})
|
})
|
||||||
|
@ -381,7 +381,7 @@ public class SignalServiceMessageSender {
|
|||||||
attachment.getCancelationSignal(),
|
attachment.getCancelationSignal(),
|
||||||
attachment.getResumableUploadSpec().orNull());
|
attachment.getResumableUploadSpec().orNull());
|
||||||
|
|
||||||
if (attachmentsV3.get()) {
|
if (attachment.getResumableUploadSpec().isPresent()) {
|
||||||
return uploadAttachmentV3(attachment, attachmentKey, attachmentData);
|
return uploadAttachmentV3(attachment, attachmentKey, attachmentData);
|
||||||
} else {
|
} else {
|
||||||
return uploadAttachmentV2(attachment, attachmentKey, attachmentData);
|
return uploadAttachmentV2(attachment, attachmentKey, attachmentData);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user