Prevent error when including self in member list

This commit is contained in:
AsamK 2021-05-13 11:56:03 +02:00
parent da29cdfe10
commit 4fd3657f3d

View file

@ -772,10 +772,11 @@ public class Manager implements Closeable {
public Pair<GroupId, List<SendMessageResult>> updateGroup(
GroupId groupId, String name, List<String> members, File avatarFile
) throws IOException, GroupNotFoundException, AttachmentInvalidException, InvalidNumberException, NotAGroupMemberException {
return sendUpdateGroupMessage(groupId,
name,
members == null ? null : getSignalServiceAddresses(members),
avatarFile);
final var membersRecipientIds = members == null ? null : getSignalServiceAddresses(members);
if (membersRecipientIds != null) {
membersRecipientIds.remove(account.getSelfRecipientId());
}
return sendUpdateGroupMessage(groupId, name, membersRecipientIds, avatarFile);
}
private Pair<GroupId, List<SendMessageResult>> sendUpdateGroupMessage(