X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/7eb7ee44f2dd85431bf8077965f73cf14d477000..15630356e18f59e8f4d29a5c9f215003ad07402e:/lib/src/main/java/org/asamk/signal/manager/Manager.java diff --git a/lib/src/main/java/org/asamk/signal/manager/Manager.java b/lib/src/main/java/org/asamk/signal/manager/Manager.java index 007a783e..d4f8b76f 100644 --- a/lib/src/main/java/org/asamk/signal/manager/Manager.java +++ b/lib/src/main/java/org/asamk/signal/manager/Manager.java @@ -1,5 +1,6 @@ package org.asamk.signal.manager; +import org.asamk.signal.manager.api.AlreadyReceivingException; import org.asamk.signal.manager.api.AttachmentInvalidException; import org.asamk.signal.manager.api.Configuration; import org.asamk.signal.manager.api.Device; @@ -38,6 +39,7 @@ import org.whispersystems.signalservice.api.util.PhoneNumberFormatter; import java.io.Closeable; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.time.Duration; import java.util.Collection; @@ -100,7 +102,7 @@ public interface Manager extends Closeable { void deleteGroup(GroupId groupId) throws IOException; Pair createGroup( - String name, Set members, File avatarFile + String name, Set members, String avatarFile ) throws IOException, AttachmentInvalidException, UnregisteredRecipientException; SendGroupMessageResults updateGroup( @@ -136,7 +138,8 @@ public interface Manager extends Closeable { boolean remove, RecipientIdentifier.Single targetAuthor, long targetSentTimestamp, - Set recipients + Set recipients, + final boolean isStory ) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException; SendMessageResults sendPaymentNotificationMessage( @@ -201,12 +204,9 @@ public interface Manager extends Closeable { /** * Receive new messages from server, returns if no new message arrive in a timespan of timeout. */ - void receiveMessages(Duration timeout, ReceiveMessageHandler handler) throws IOException; - - /** - * Receive new messages from server, returns only if the thread is interrupted. - */ - void receiveMessages(ReceiveMessageHandler handler) throws IOException; + public void receiveMessages( + Optional timeout, Optional maxMessages, ReceiveMessageHandler handler + ) throws IOException, AlreadyReceivingException; void setReceiveConfig(ReceiveConfig receiveConfig); @@ -272,6 +272,8 @@ public interface Manager extends Closeable { void addClosedListener(Runnable listener); + InputStream retrieveAttachment(final String id) throws IOException; + @Override void close() throws IOException;