]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/Manager.java
Update README.md
[signal-cli] / src / main / java / org / asamk / signal / Manager.java
index 29e75ee917d80b8c7c25ca253b0e39ea963be2c5..907858247892d41d6c8792887fe45c87f70683b4 100644 (file)
@@ -478,9 +478,11 @@ class Manager implements Signal {
         if (g == null) {
             throw new GroupNotFoundException(groupId);
         }
-        Set<String> members = g.members;
-        members.remove(this.username);
-        sendMessage(message, members);
+
+        // Don't send group message to ourself
+        final List<String> membersSend = new ArrayList<>(g.members);
+        membersSend.remove(this.username);
+        sendMessage(message, membersSend);
     }
 
     public void sendQuitGroupMessage(byte[] groupId) throws GroupNotFoundException, IOException, EncapsulatedExceptions, UntrustedIdentityException {
@@ -555,7 +557,8 @@ class Manager implements Signal {
                 .asGroupMessage(group.build())
                 .build();
 
-        final Set<String> membersSend = g.members;
+        // Don't send group message to ourself
+        final List<String> membersSend = new ArrayList<>(g.members);
         membersSend.remove(this.username);
         sendMessage(message, membersSend);
         return g.groupId;