aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-13 11:57:02 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-13 11:57:02 +0200
commit6a28b5a9fa9baa7cbbad596ebf135f3841b5d63b (patch)
treebe460a8c75f7842d744f1afd19d9e00653dcedc2 /src/main/java
parente41a9483bdc1aa772b9f69695cb96643effb1827 (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.java6
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);
}
}
}