X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/b7f05a1c806c37a044ce21f87e72598fcd342bb3..a91e3f762e0e5d6a9cf9e208fe85207d7829e22d:/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java diff --git a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java index 325ae7a1..6606e966 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java @@ -335,12 +335,20 @@ public class DbusSignalImpl implements Signal { if (avatar.isEmpty()) { avatar = null; } - final var results = m.updateGroup(groupId == null ? null : GroupId.unknownVersion(groupId), - name, - members, - avatar == null ? null : new File(avatar)); - checkSendMessageResults(0, results.second()); - return results.first().serialize(); + if (groupId == null) { + final var results = m.createGroup(name, members, avatar == null ? null : new File(avatar)); + checkSendMessageResults(0, results.second()); + return results.first().serialize(); + } else { + final var results = m.updateGroup(GroupId.unknownVersion(groupId), + name, + null, + members, + null, + avatar == null ? null : new File(avatar)); + checkSendMessageResults(results.first(), results.second()); + return groupId; + } } catch (IOException e) { throw new Error.Failure(e.getMessage()); } catch (GroupNotFoundException | NotAGroupMemberException e) {