]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/JoinGroupCommand.java
Add Pair record
[signal-cli] / src / main / java / org / asamk / signal / commands / JoinGroupCommand.java
index 1e06ea9ce9d3ca349cb76f4e0136b1e74f455876..5501c5d60cf73b368eee1483b83722a580396971 100644 (file)
@@ -55,8 +55,7 @@ public class JoinGroupCommand implements JsonRpcLocalCommand {
         try {
             final var results = m.joinGroup(linkUrl);
             var newGroupId = results.first();
-            if (outputWriter instanceof JsonWriter) {
-                final var writer = (JsonWriter) outputWriter;
+            if (outputWriter instanceof JsonWriter writer) {
                 if (!m.getGroup(newGroupId).isMember()) {
                     writer.write(Map.of("groupId", newGroupId.toBase64(), "onlyRequested", true));
                 } else {
@@ -70,7 +69,7 @@ public class JoinGroupCommand implements JsonRpcLocalCommand {
                     writer.println("Joined group \"{}\"", newGroupId.toBase64());
                 }
             }
-            handleSendMessageResults(results.second().getResults());
+            handleSendMessageResults(results.second().results());
         } catch (GroupPatchNotAcceptedException e) {
             throw new UserErrorException("Failed to join group, maybe already a member");
         } catch (IOException e) {