mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-03 15:58:40 +00:00
Remove all legacy uploads to cdn0.
This commit is contained in:
@@ -307,7 +307,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
||||
}
|
||||
}
|
||||
|
||||
private Optional<SignalServiceAttachmentStream> getSystemAvatar(@Nullable Uri uri) {
|
||||
private Optional<SignalServiceAttachmentStream> getSystemAvatar(@Nullable Uri uri) throws IOException {
|
||||
if (uri == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
@@ -329,6 +329,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
||||
.withStream(fd.createInputStream())
|
||||
.withContentType("image/*")
|
||||
.withLength(fd.getLength())
|
||||
.withResumableUploadSpec(AppDependencies.getSignalServiceMessageSender().getResumableUploadSpec())
|
||||
.build());
|
||||
} catch (IOException e) {
|
||||
// Ignored
|
||||
@@ -355,6 +356,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
||||
.withStream(new ByteArrayInputStream(data))
|
||||
.withContentType("image/*")
|
||||
.withLength(data.length)
|
||||
.withResumableUploadSpec(AppDependencies.getSignalServiceMessageSender().getResumableUploadSpec())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ public class MultiDeviceProfileKeyUpdateJob extends BaseJob {
|
||||
.withStream(new ByteArrayInputStream(baos.toByteArray()))
|
||||
.withContentType("application/octet-stream")
|
||||
.withLength(baos.toByteArray().length)
|
||||
.withResumableUploadSpec(messageSender.getResumableUploadSpec())
|
||||
.build();
|
||||
|
||||
SignalServiceSyncMessage syncMessage = SignalServiceSyncMessage.forContacts(new ContactsMessage(attachmentStream, false));
|
||||
|
||||
@@ -197,7 +197,9 @@ public abstract class PushSendJob extends SendJob {
|
||||
return Optional.of(ProfileKeyUtil.getSelfProfileKey().serialize());
|
||||
}
|
||||
|
||||
protected SignalServiceAttachment getAttachmentFor(Attachment attachment) {
|
||||
protected SignalServiceAttachment getAttachmentFor(Contact.Avatar avatar) {
|
||||
Attachment attachment = avatar.getAttachment();
|
||||
|
||||
try {
|
||||
if (attachment.getUri() == null || attachment.size == 0) throw new IOException("Assertion failed, outgoing attachment has no data!");
|
||||
InputStream is = PartAuthority.getAttachmentStream(context, attachment.getUri());
|
||||
@@ -214,6 +216,7 @@ public abstract class PushSendJob extends SendJob {
|
||||
.withHeight(attachment.height)
|
||||
.withCaption(attachment.caption)
|
||||
.withUuid(attachment.uuid)
|
||||
.withResumableUploadSpec(AppDependencies.getSignalServiceMessageSender().getResumableUploadSpec())
|
||||
.withListener(new SignalServiceAttachment.ProgressListener() {
|
||||
@Override
|
||||
public void onAttachmentProgress(long total, long progress) {
|
||||
@@ -454,7 +457,7 @@ public abstract class PushSendJob extends SendJob {
|
||||
if (contact.getAvatar() != null && contact.getAvatar().getAttachment() != null) {
|
||||
SignalServiceAttachment attachment = getAttachmentPointerFor(contact.getAvatar().getAttachment());
|
||||
if (attachment == null) {
|
||||
attachment = getAttachmentFor(contact.getAvatar().getAttachment());
|
||||
attachment = getAttachmentFor(contact.getAvatar());
|
||||
}
|
||||
avatar = SharedContact.Avatar.newBuilder().withAttachment(attachment)
|
||||
.withProfileFlag(contact.getAvatar().isProfile())
|
||||
|
||||
Reference in New Issue
Block a user