aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-13 11:57:02 +0200
committerChristian Schneppe <christian@pix-art.de>2016-05-13 21:56:29 +0200
commitddce327009e8838bfa093338fdf2ff0adba7f917 (patch)
treeb3d533c24f1d15c62cf4f4473a59d36d460613c3 /src/main
parente23147211532a04dd2c5b1dc1c8a56f91bb91afb (diff)
don't show duplicate status message in contact details
Diffstat (limited to 'src/main')
-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);
}
}
}