]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/Manager.java
Update gradle wrapper
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / Manager.java
index 61f6e1d6ca316c67d1547ef28dc69dd82f9fa0c0..6e9c86ad41c8c6e4c4f13b198d4077f07e703a9c 100644 (file)
@@ -40,7 +40,6 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
 
 public interface Manager extends Closeable {
 
@@ -60,6 +59,7 @@ public interface Manager extends Closeable {
         var account = SignalAccount.load(pathConfig.dataPath(), number, true, trustNewIdentity);
 
         if (!account.isRegistered()) {
+            account.close();
             throw new NotRegisteredException();
         }
 
@@ -89,7 +89,7 @@ public interface Manager extends Closeable {
                 .filter(File::isFile)
                 .map(File::getName)
                 .filter(file -> PhoneNumberFormatter.isValidNumber(file, null))
-                .collect(Collectors.toList());
+                .toList();
     }
 
     String getSelfNumber();
@@ -174,6 +174,10 @@ public interface Manager extends Closeable {
 
     SendMessageResults sendEndSessionMessage(Set<RecipientIdentifier.Single> recipients) throws IOException;
 
+    void deleteRecipient(RecipientIdentifier.Single recipient) throws IOException;
+
+    void deleteContact(RecipientIdentifier.Single recipient) throws IOException;
+
     void setContactName(
             RecipientIdentifier.Single recipient, String name
     ) throws NotMasterDeviceException, IOException;