From 6a28b5a9fa9baa7cbbad596ebf135f3841b5d63b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 13 May 2016 11:57:02 +0200 Subject: don't show duplicate status message in contact details --- src/main/java/eu/siacs/conversations/entities/Presences.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/entities/Presences.java b/src/main/java/eu/siacs/conversations/entities/Presences.java index 7630fd936..c80783317 100644 --- a/src/main/java/eu/siacs/conversations/entities/Presences.java +++ b/src/main/java/eu/siacs/conversations/entities/Presences.java @@ -75,9 +75,9 @@ public class Presences { ArrayList messages = new ArrayList<>(); synchronized (this.presences) { for(Presence presence : this.presences.values()) { - String message = presence.getMessage(); - if (message != null && !message.trim().isEmpty()) { - messages.add(message.trim()); + String message = presence.getMessage() == null ? null : presence.getMessage().trim(); + if (message != null && !message.isEmpty() && !messages.contains(message)) { + messages.add(message); } } } -- cgit v1.2.3