X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/d267974223294b9ac08491999d8f2bece2b80c54..4f2261e86f493a9c8954c02c52ddaa9a46490d20:/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 77b3bc99..e662ab2a 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java @@ -44,7 +44,10 @@ public class DbusSignalImpl implements Signal { return sendMessage(message, attachments, recipients); } - private static void checkSendMessageResults(long timestamp, List results) throws DBusExecutionException { + private static void checkSendMessageResults( + long timestamp, + List results + ) throws DBusExecutionException { List errors = ErrorUtils.getErrorMessagesFromSendMessageResults(results); if (errors.size() == 0) { return; @@ -164,13 +167,29 @@ public class DbusSignalImpl implements Signal { if (group == null) { return Collections.emptyList(); } else { - return group.getMembers().stream().map(m::resolveSignalServiceAddress).map(SignalServiceAddress::getLegacyIdentifier).collect(Collectors.toList()); + return group.getMembers() + .stream() + .map(m::resolveSignalServiceAddress) + .map(SignalServiceAddress::getLegacyIdentifier) + .collect(Collectors.toList()); } } @Override - public byte[] updateGroup(final byte[] groupId, final String name, final List members, final String avatar) { + public byte[] updateGroup(byte[] groupId, String name, List members, String avatar) { try { + if (groupId.length == 0) { + groupId = null; + } + if (name.isEmpty()) { + name = null; + } + if (members.isEmpty()) { + members = null; + } + if (avatar.isEmpty()) { + avatar = null; + } final Pair> results = m.updateGroup(groupId, name, members, avatar); checkSendMessageResults(0, results.second()); return results.first();