]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/util/AttachmentUtils.java
Remove unnecessary proto conversion
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / util / AttachmentUtils.java
index 5504640fa8ca3dbb592531031269505f7a3125bb..ac15a30a9cf9342598b94c047dc0957e7facaf91 100644 (file)
@@ -1,7 +1,6 @@
 package org.asamk.signal.manager.util;
 
 import org.asamk.signal.manager.api.AttachmentInvalidException;
-import org.signal.protos.resumableuploads.ResumableUpload;
 import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
 import org.whispersystems.signalservice.api.push.exceptions.ResumeLocationInvalidException;
 import org.whispersystems.signalservice.api.util.StreamDetails;
@@ -14,23 +13,22 @@ import java.util.UUID;
 public class AttachmentUtils {
 
     public static SignalServiceAttachmentStream createAttachmentStream(
-            String attachment, ResumableUpload resumableUpload
+            String attachment, ResumableUploadSpec resumableUploadSpec
     ) throws AttachmentInvalidException {
         try {
             final var streamDetails = Utils.createStreamDetails(attachment);
 
-            return createAttachmentStream(streamDetails.first(), streamDetails.second(), resumableUpload);
+            return createAttachmentStream(streamDetails.first(), streamDetails.second(), resumableUploadSpec);
         } catch (IOException e) {
             throw new AttachmentInvalidException(attachment, e);
         }
     }
 
     public static SignalServiceAttachmentStream createAttachmentStream(
-            StreamDetails streamDetails, Optional<String> name, ResumableUpload resumableUpload
+            StreamDetails streamDetails, Optional<String> name, ResumableUploadSpec resumableUploadSpec
     ) throws ResumeLocationInvalidException {
         // TODO maybe add a parameter to set the voiceNote, borderless, preview, width, height and caption option
         final var uploadTimestamp = System.currentTimeMillis();
-        final var resumableUploadSpec = ResumableUploadSpec.from(resumableUpload);
         return SignalServiceAttachmentStream.newStreamBuilder()
                 .withStream(streamDetails.getStream())
                 .withContentType(streamDetails.getContentType())