X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/0ad42a72ab64e663733eb7ab89b6de5ec9f80a4a..5c1127ced688f41d00dd61ae00bb921689891966:/src/main/java/org/asamk/signal/Manager.java diff --git a/src/main/java/org/asamk/signal/Manager.java b/src/main/java/org/asamk/signal/Manager.java index 5bff3cf3..de37cc92 100644 --- a/src/main/java/org/asamk/signal/Manager.java +++ b/src/main/java/org/asamk/signal/Manager.java @@ -411,7 +411,9 @@ class Manager implements Signal { } SignalServiceDataMessage message = messageBuilder.build(); - sendMessage(message, groupStore.getGroup(groupId).members); + Set members = groupStore.getGroup(groupId).members; + members.remove(this.username); + sendMessage(message, members); } public void sendQuitGroupMessage(byte[] groupId) throws GroupNotFoundException, IOException, EncapsulatedExceptions, UntrustedIdentityException { @@ -423,7 +425,11 @@ class Manager implements Signal { .asGroupMessage(group) .build(); - sendMessage(message, groupStore.getGroup(groupId).members); + final GroupInfo g = groupStore.getGroup(groupId); + g.members.remove(this.username); + groupStore.updateGroup(g); + + sendMessage(message, g.members); } public byte[] sendUpdateGroupMessage(byte[] groupId, String name, Collection members, String avatarFile) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, UntrustedIdentityException { @@ -473,7 +479,9 @@ class Manager implements Signal { .asGroupMessage(group.build()) .build(); - sendMessage(message, g.members); + final Set membersSend = g.members; + membersSend.remove(this.username); + sendMessage(message, membersSend); return g.groupId; } @@ -637,6 +645,7 @@ class Manager implements Signal { try { group = groupStore.getGroup(groupInfo.getGroupId()); group.members.remove(source); + groupStore.updateGroup(group); } catch (GroupNotFoundException e) { } break;