From e26d84254979101374c5abb4a8788c9dd7e6349d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 3 Jun 2016 18:43:45 +0200 Subject: don't use a bookmarks name if it's empty --- src/main/java/eu/siacs/conversations/entities/Bookmark.java | 5 +++-- src/main/java/eu/siacs/conversations/entities/Conversation.java | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/entities/Bookmark.java b/src/main/java/eu/siacs/conversations/entities/Bookmark.java index c5c4ff5dd..f5cfba3a2 100644 --- a/src/main/java/eu/siacs/conversations/entities/Bookmark.java +++ b/src/main/java/eu/siacs/conversations/entities/Bookmark.java @@ -52,8 +52,9 @@ public class Bookmark extends Element implements ListItem { public String getDisplayName() { if (this.mJoinedConversation != null) { return this.mJoinedConversation.getName(); - } else if (getBookmarkName() != null) { - return getBookmarkName(); + } else if (getBookmarkName() != null + && !getBookmarkName().trim().isEmpty()) { + return getBookmarkName().trim(); } else { return this.getJid().getLocalpart(); } diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 017a85f51..8dacf8089 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -433,8 +433,10 @@ public class Conversation extends AbstractEntity implements Blockable { if (getMode() == MODE_MULTI) { if (getMucOptions().getSubject() != null) { return getMucOptions().getSubject(); - } else if (bookmark != null && bookmark.getBookmarkName() != null) { - return bookmark.getBookmarkName(); + } else if (bookmark != null + && bookmark.getBookmarkName() != null + && !bookmark.getBookmarkName().trim().isEmpty()) { + return bookmark.getBookmarkName().trim(); } else { String generatedName = getMucOptions().createNameFromParticipants(); if (generatedName != null) { -- cgit v1.2.3