don't show duplicate status message in contact details

This commit is contained in:
Daniel Gultsch 2016-05-13 11:57:02 +02:00
parent e41a9483bd
commit 6a28b5a9fa

View file

@ -75,9 +75,9 @@ public class Presences {
ArrayList<String> messages = new ArrayList<>(); ArrayList<String> messages = new ArrayList<>();
synchronized (this.presences) { synchronized (this.presences) {
for(Presence presence : this.presences.values()) { for(Presence presence : this.presences.values()) {
String message = presence.getMessage(); String message = presence.getMessage() == null ? null : presence.getMessage().trim();
if (message != null && !message.trim().isEmpty()) { if (message != null && !message.isEmpty() && !messages.contains(message)) {
messages.add(message.trim()); messages.add(message);
} }
} }
} }