mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-27 09:34:20 +01:00
Upload attachment before sending to fix sending attachments to multiple recipients
Fixes #259
This commit is contained in:
@@ -47,18 +47,18 @@ import static org.whispersystems.signalservice.internal.util.Util.isEmpty;
|
||||
class Utils {
|
||||
|
||||
static List<SignalServiceAttachment> getSignalServiceAttachments(List<String> attachments) throws AttachmentInvalidException {
|
||||
List<SignalServiceAttachment> SignalServiceAttachments = null;
|
||||
List<SignalServiceAttachment> signalServiceAttachments = null;
|
||||
if (attachments != null) {
|
||||
SignalServiceAttachments = new ArrayList<>(attachments.size());
|
||||
signalServiceAttachments = new ArrayList<>(attachments.size());
|
||||
for (String attachment : attachments) {
|
||||
try {
|
||||
SignalServiceAttachments.add(createAttachment(new File(attachment)));
|
||||
signalServiceAttachments.add(createAttachment(new File(attachment)));
|
||||
} catch (IOException e) {
|
||||
throw new AttachmentInvalidException(attachment, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return SignalServiceAttachments;
|
||||
return signalServiceAttachments;
|
||||
}
|
||||
|
||||
private static String getFileMimeType(File file) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user