kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix issue with GV1 avatars using attachmentsV3.
rodzic
870cee5707
commit
813c820227
|
@ -94,15 +94,15 @@ public final class AttachmentUploadJob extends BaseJob {
|
|||
|
||||
@Override
|
||||
public void onRun() throws Exception {
|
||||
final ResumableUploadSpec resumableUploadSpec;
|
||||
if (FeatureFlags.attachmentsV3()) {
|
||||
Data inputData = requireInputData();
|
||||
if (!inputData.hasString(ResumableUploadSpecJob.KEY_RESUME_SPEC)) {
|
||||
throw new ResumeLocationInvalidException("V3 Attachment upload requires a ResumableUploadSpec");
|
||||
}
|
||||
Data inputData = getInputData();
|
||||
|
||||
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));
|
||||
} else {
|
||||
Log.d(TAG, "Using attachments V2");
|
||||
resumableUploadSpec = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,10 +168,16 @@ public abstract class PushSendJob extends SendJob {
|
|||
return new HashSet<>(Stream.of(attachments).map(a -> {
|
||||
AttachmentUploadJob attachmentUploadJob = new AttachmentUploadJob(((DatabaseAttachment) a).getAttachmentId());
|
||||
|
||||
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
||||
.then(new ResumableUploadSpecJob())
|
||||
.then(attachmentUploadJob)
|
||||
.enqueue();
|
||||
if (message.isGroup()) {
|
||||
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
||||
.then(attachmentUploadJob)
|
||||
.enqueue();
|
||||
} else {
|
||||
jobManager.startChain(AttachmentCompressionJob.fromAttachment((DatabaseAttachment) a, false, -1))
|
||||
.then(new ResumableUploadSpecJob())
|
||||
.then(attachmentUploadJob)
|
||||
.enqueue();
|
||||
}
|
||||
|
||||
return attachmentUploadJob.getId();
|
||||
})
|
||||
|
|
|
@ -381,7 +381,7 @@ public class SignalServiceMessageSender {
|
|||
attachment.getCancelationSignal(),
|
||||
attachment.getResumableUploadSpec().orNull());
|
||||
|
||||
if (attachmentsV3.get()) {
|
||||
if (attachment.getResumableUploadSpec().isPresent()) {
|
||||
return uploadAttachmentV3(attachment, attachmentKey, attachmentData);
|
||||
} else {
|
||||
return uploadAttachmentV2(attachment, attachmentKey, attachmentData);
|
||||
|
|
Ładowanie…
Reference in New Issue