From 4ea3d94d0768f452899b45120df50a67fd1b8443 Mon Sep 17 00:00:00 2001 From: AsamK Date: Mon, 13 Jun 2022 15:35:25 +0200 Subject: [PATCH] Improve number filtering of listContacts command If the given number is not registered, don't output all recipients --- lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java index 201f0931..5548e5ac 100644 --- a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java +++ b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java @@ -989,6 +989,9 @@ class ManagerImpl implements Manager { return null; } }).filter(Objects::nonNull).collect(Collectors.toSet()); + if (!recipients.isEmpty() && recipientIds.isEmpty()) { + return List.of(); + } // refresh profiles of explicitly given recipients context.getProfileHelper().refreshRecipientProfiles(recipientIds); return account.getRecipientStore().getRecipients(onlyContacts, blocked, recipientIds, name);