]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
Refactor NoteToSelf to singleton class
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusSignalImpl.java
index c73918ef6c506a757d09cd19f05226d6953799d5..e975a67153a09b049e937d12dc686c84f95f90bc 100644 (file)
@@ -276,7 +276,7 @@ public class DbusSignalImpl implements Signal {
     ) throws Error.AttachmentInvalid, Error.Failure, Error.UntrustedIdentity {
         try {
             final var results = m.sendMessage(new Message(message, attachments),
-                    Set.of(new RecipientIdentifier.NoteToSelf()));
+                    Set.of(RecipientIdentifier.NoteToSelf.INSTANCE));
             checkSendMessageResults(results.getTimestamp(), results.getResults());
             return results.getTimestamp();
         } catch (AttachmentInvalidException e) {
@@ -505,14 +505,14 @@ public class DbusSignalImpl implements Signal {
             final String aboutEmoji,
             String avatarPath,
             final boolean removeAvatar
-            ) {
+    ) {
         try {
             if (avatarPath.isEmpty()) {
                 avatarPath = null;
             }
             Optional<File> avatarFile = removeAvatar
                     ? Optional.absent()
-                            : avatarPath == null ? null : Optional.of(new File(avatarPath));
+                    : avatarPath == null ? null : Optional.of(new File(avatarPath));
             m.setProfile(givenName, familyName, about, aboutEmoji, avatarFile);
         } catch (IOException e) {
             throw new Error.Failure(e.getMessage());