Don’t remove self from group when sending group messages

This commit is contained in:
AsamK 2016-06-28 12:35:18 +02:00
parent b1f0d40d44
commit 7ce080b6db

View file

@ -478,9 +478,11 @@ class Manager implements Signal {
if (g == null) { if (g == null) {
throw new GroupNotFoundException(groupId); throw new GroupNotFoundException(groupId);
} }
Set<String> members = g.members;
members.remove(this.username); // Don't send group message to ourself
sendMessage(message, members); 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 { public void sendQuitGroupMessage(byte[] groupId) throws GroupNotFoundException, IOException, EncapsulatedExceptions, UntrustedIdentityException {
@ -555,6 +557,7 @@ class Manager implements Signal {
.asGroupMessage(group.build()) .asGroupMessage(group.build())
.build(); .build();
// Don't send group message to ourself
final List<String> membersSend = new ArrayList<>(g.members); final List<String> membersSend = new ArrayList<>(g.members);
membersSend.remove(this.username); membersSend.remove(this.username);
sendMessage(message, membersSend); sendMessage(message, membersSend);