From 7ce080b6db28909a7749682c01b91be1778bf277 Mon Sep 17 00:00:00 2001 From: AsamK Date: Tue, 28 Jun 2016 12:35:18 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20remove=20self=20from=20group=20?= =?UTF-8?q?when=20sending=20group=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/asamk/signal/Manager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/asamk/signal/Manager.java b/src/main/java/org/asamk/signal/Manager.java index d96537fe..90785824 100644 --- a/src/main/java/org/asamk/signal/Manager.java +++ b/src/main/java/org/asamk/signal/Manager.java @@ -478,9 +478,11 @@ class Manager implements Signal { if (g == null) { throw new GroupNotFoundException(groupId); } - Set members = g.members; - members.remove(this.username); - sendMessage(message, members); + + // Don't send group message to ourself + final List membersSend = new ArrayList<>(g.members); + membersSend.remove(this.username); + sendMessage(message, membersSend); } public void sendQuitGroupMessage(byte[] groupId) throws GroupNotFoundException, IOException, EncapsulatedExceptions, UntrustedIdentityException { @@ -555,6 +557,7 @@ class Manager implements Signal { .asGroupMessage(group.build()) .build(); + // Don't send group message to ourself final List membersSend = new ArrayList<>(g.members); membersSend.remove(this.username); sendMessage(message, membersSend);