X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/659761f00688523970bdc3d99aea2d7f7806a3af..32818a8608f5bddc46ad5c7dc442f509c939791c:/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 c7131d39..65191232 100644 --- a/lib/src/main/java/org/asamk/signal/manager/Manager.java +++ b/lib/src/main/java/org/asamk/signal/manager/Manager.java @@ -6,6 +6,7 @@ import org.asamk.signal.manager.api.Identity; import org.asamk.signal.manager.api.InactiveGroupLinkException; import org.asamk.signal.manager.api.InvalidDeviceLinkException; import org.asamk.signal.manager.api.Message; +import org.asamk.signal.manager.api.MessageEnvelope; import org.asamk.signal.manager.api.Pair; import org.asamk.signal.manager.api.RecipientIdentifier; import org.asamk.signal.manager.api.SendGroupMessageResults; @@ -25,13 +26,7 @@ import org.asamk.signal.manager.storage.identities.TrustNewIdentity; import org.asamk.signal.manager.storage.recipients.Contact; import org.asamk.signal.manager.storage.recipients.Profile; import org.asamk.signal.manager.storage.recipients.RecipientAddress; -import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentRemoteId; -import org.whispersystems.signalservice.api.messages.SignalServiceContent; -import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope; -import org.whispersystems.signalservice.api.push.SignalServiceAddress; -import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException; import org.whispersystems.signalservice.api.util.PhoneNumberFormatter; -import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException; import java.io.Closeable; import java.io.File; @@ -72,6 +67,14 @@ public interface Manager extends Closeable { return new ManagerImpl(account, pathConfig, serviceEnvironmentConfig, userAgent); } + static void initLogger() { + LibSignalLogger.initLogger(); + } + + static boolean isValidNumber(final String e164Number, final String countryCode) { + return PhoneNumberFormatter.isValidNumber(e164Number, countryCode); + } + static List getAllLocalNumbers(File settingsPath) { var pathConfig = PathConfig.createDefault(settingsPath); final var dataPath = pathConfig.dataPath(); @@ -119,9 +122,9 @@ public interface Manager extends Closeable { void addDeviceLink(URI linkUri) throws IOException, InvalidDeviceLinkException; - void setRegistrationLockPin(Optional pin) throws IOException, UnauthenticatedResponseException; + void setRegistrationLockPin(Optional pin) throws IOException; - Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws UnregisteredUserException; + Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws IOException; List getGroups(); @@ -175,7 +178,7 @@ public interface Manager extends Closeable { void setContactName( RecipientIdentifier.Single recipient, String name - ) throws NotMasterDeviceException, UnregisteredUserException; + ) throws NotMasterDeviceException, IOException; void setContactBlocked( RecipientIdentifier.Single recipient, boolean blocked @@ -223,8 +226,6 @@ public interface Manager extends Closeable { boolean isContactBlocked(RecipientIdentifier.Single recipient); - File getAttachmentFile(SignalServiceAttachmentRemoteId attachmentId); - void sendContacts() throws IOException; List> getContacts(); @@ -245,13 +246,11 @@ public interface Manager extends Closeable { boolean trustIdentityAllKeys(RecipientIdentifier.Single recipient); - SignalServiceAddress resolveSignalServiceAddress(SignalServiceAddress address); - @Override void close() throws IOException; interface ReceiveMessageHandler { - void handleMessage(SignalServiceEnvelope envelope, SignalServiceContent decryptedContent, Throwable e); + void handleMessage(MessageEnvelope envelope, Throwable e); } }