This commit is contained in:
AsamK 2022-06-04 11:52:42 +02:00
parent cb5e3c6bf7
commit 3ad87e1362
3 changed files with 6 additions and 8 deletions

View file

@ -5,8 +5,6 @@ import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStre
import org.whispersystems.signalservice.api.util.StreamDetails;
import org.whispersystems.signalservice.internal.push.http.ResumableUploadSpec;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

View file

@ -19,7 +19,6 @@ import java.net.URLConnection;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Base64;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@ -51,8 +50,7 @@ public class Utils {
public static Pair<StreamDetails, Optional<String>> createStreamDetailsFromDataURI(final String dataURI) {
final DataURI uri = DataURI.of(dataURI);
return new Pair<>(new StreamDetails(
new ByteArrayInputStream(uri.data()), uri.mediaType(), uri.data().length),
return new Pair<>(new StreamDetails(new ByteArrayInputStream(uri.data()), uri.mediaType(), uri.data().length),
Optional.ofNullable(uri.parameter().get("filename")));
}

View file

@ -55,7 +55,9 @@ public class SendCommand implements JsonRpcLocalCommand {
mut.addArgument("--message-from-stdin")
.action(Arguments.storeTrue())
.help("Read the message from standard input.");
subparser.addArgument("-a", "--attachment").nargs("*").help("Add an attachment. "
subparser.addArgument("-a", "--attachment")
.nargs("*")
.help("Add an attachment. "
+ "Can be either a file path or a data URI. Data URI encoded attachments must follow the RFC 2397. Additionally a file name can be added, e.g. "
+ "data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>.");
subparser.addArgument("-e", "--end-session", "--endsession")