diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-13 11:57:02 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-13 11:57:02 +0200 |
commit | 6a28b5a9fa9baa7cbbad596ebf135f3841b5d63b (patch) | |
tree | be460a8c75f7842d744f1afd19d9e00653dcedc2 /src/main/java | |
parent | e41a9483bdc1aa772b9f69695cb96643effb1827 (diff) |
don't show duplicate status message in contact details
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Presences.java | 6 |
1 files changed, 3 insertions, 3 deletions
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<String> 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); } } } |