import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
@Override
public Pair<GroupId, SendGroupMessageResults> createGroup(
- String name, Set<RecipientIdentifier.Single> members, File avatarFile
+ String name, Set<RecipientIdentifier.Single> members, String avatarFile
) throws IOException, AttachmentInvalidException, UnregisteredRecipientException {
return context.getGroupHelper()
.createGroup(name,
final var textAttachment = AttachmentUtils.createAttachmentStream(new StreamDetails(new ByteArrayInputStream(
messageBytes), MimeUtils.LONG_TEXT, messageBytes.length), Optional.empty());
messageBuilder.withBody(message.messageText().substring(0, 2000));
- messageBuilder.withAttachment(textAttachment);
+ messageBuilder.withAttachment(context.getAttachmentHelper().uploadAttachment(textAttachment));
} else {
messageBuilder.withBody(message.messageText());
}
quote.message(),
List.of(),
resolveMentions(quote.mentions()),
- SignalServiceDataMessage.Quote.Type.NORMAL));
+ SignalServiceDataMessage.Quote.Type.NORMAL,
+ List.of()));
}
if (message.sticker().isPresent()) {
final var sticker = message.sticker().get();
byte[] receipt, String note, RecipientIdentifier.Single recipient
) throws IOException {
final var paymentNotification = new SignalServiceDataMessage.PaymentNotification(receipt, note);
- final var payment = new SignalServiceDataMessage.Payment(paymentNotification);
+ final var payment = new SignalServiceDataMessage.Payment(paymentNotification, null);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withPayment(payment);
try {
return sendMessage(messageBuilder, Set.of(recipient));
}
}
+ @Override
+ public InputStream retrieveAttachment(final String id) throws IOException {
+ return context.getAttachmentHelper().retrieveAttachment(id).getStream();
+ }
+
@Override
public void close() {
Thread thread;