]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
Added missing file attachment attributes in JsonAttachment output
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusManagerImpl.java
index b59be923d0c0091ab8a3935166b3dc72690305f7..0ccff7351415d8c12825cfd67c380c41d7af4886 100644 (file)
@@ -46,6 +46,7 @@ import org.freedesktop.dbus.types.Variant;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.time.Duration;
@@ -146,7 +147,7 @@ public class DbusManagerImpl implements Manager {
                 emptyIfNull(updateProfile.getFamilyName()),
                 emptyIfNull(updateProfile.getAbout()),
                 emptyIfNull(updateProfile.getAboutEmoji()),
-                updateProfile.getAvatar() == null ? "" : updateProfile.getAvatar().getPath(),
+                updateProfile.getAvatar() == null ? "" : updateProfile.getAvatar(),
                 updateProfile.isDeleteAvatar());
     }
 
@@ -230,11 +231,11 @@ public class DbusManagerImpl implements Manager {
 
     @Override
     public Pair<GroupId, SendGroupMessageResults> createGroup(
-            final String name, final Set<RecipientIdentifier.Single> members, final File avatarFile
+            final String name, final Set<RecipientIdentifier.Single> members, final String avatarFile
     ) throws IOException, AttachmentInvalidException {
         final var newGroupId = signal.createGroup(emptyIfNull(name),
                 members.stream().map(RecipientIdentifier.Single::getIdentifier).toList(),
-                avatarFile == null ? "" : avatarFile.getPath());
+                avatarFile == null ? "" : avatarFile);
         return new Pair<>(GroupId.unknownVersion(newGroupId), new SendGroupMessageResults(0, List.of()));
     }
 
@@ -252,7 +253,7 @@ public class DbusManagerImpl implements Manager {
         if (updateGroup.getAvatarFile() != null) {
             group.Set("org.asamk.Signal.Group",
                     "Avatar",
-                    updateGroup.getAvatarFile() == null ? "" : updateGroup.getAvatarFile().getPath());
+                    updateGroup.getAvatarFile() == null ? "" : updateGroup.getAvatarFile());
         }
         if (updateGroup.getExpirationTimer() != null) {
             group.Set("org.asamk.Signal.Group", "MessageExpirationTimer", updateGroup.getExpirationTimer());
@@ -777,6 +778,7 @@ public class DbusManagerImpl implements Manager {
                                 Optional.empty(),
                                 List.of(),
                                 List.of(),
+                                List.of(),
                                 List.of())),
                         Optional.empty(),
                         Optional.empty(),
@@ -851,6 +853,7 @@ public class DbusManagerImpl implements Manager {
                                         Optional.empty(),
                                         List.of(),
                                         List.of(),
+                                        List.of(),
                                         List.of())),
                                 Optional.empty())),
                                 Optional.empty(),
@@ -916,6 +919,11 @@ public class DbusManagerImpl implements Manager {
         }).toList();
     }
 
+    @Override
+    public InputStream retrieveAttachment(final String id) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
     @SuppressWarnings("unchecked")
     private <T> T getValue(
             final Map<String, Variant<?>> stringVariantMap, final String field