aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-17 17:31:26 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-17 17:31:26 +0100
commit8865cc406c893dcdb167ab3d89ce5d2c668c2799 (patch)
treeadcc7212972905b114510ed3c1cf75b37c7580bd /src/main/java
parent1a5af45afbb7302ae08d5475b647602a6f0463c2 (diff)
trim search before searching
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Contact.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java
index 0b6c900a..a451c142 100644
--- a/src/main/java/eu/siacs/conversations/entities/Contact.java
+++ b/src/main/java/eu/siacs/conversations/entities/Contact.java
@@ -145,10 +145,10 @@ public class Contact implements ListItem {
}
public boolean match(String needle) {
- if (needle == null) {
+ if (needle == null || needle.isEmpty()) {
return true;
}
- needle = needle.toLowerCase();
+ needle = needle.toLowerCase().trim();
String[] parts = needle.split("\\s+");
if (parts.length > 1) {
for(int i = 0; i < parts.length; ++i) {