diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-06-04 09:57:04 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-04 09:57:04 +0200 |
commit | c54d30ac003fec40b5263cf9948c20d3163eda7b (patch) | |
tree | 7d4cfbf918bd4812782c2851d6c838a153ab5f5f /src/main/java/eu/siacs/conversations/entities | |
parent | 398eacc0f022aec869cac003e61ced7215c178fa (diff) | |
parent | 6639d0f23bb983cae7234d6b15f9875464c67093 (diff) |
Merge remote-tracking branch 'refs/remotes/siacs/master'
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
3 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Bookmark.java b/src/main/java/eu/siacs/conversations/entities/Bookmark.java index 7c2f73b36..3f3707d01 100644 --- a/src/main/java/eu/siacs/conversations/entities/Bookmark.java +++ b/src/main/java/eu/siacs/conversations/entities/Bookmark.java @@ -51,8 +51,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 c194ad7d2..f10cd6780 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) { diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 043bc03d0..159dced15 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -503,8 +503,8 @@ public class MucOptions { public String getProposedNick() { if (conversation.getBookmark() != null && conversation.getBookmark().getNick() != null - && !conversation.getBookmark().getNick().isEmpty()) { - return conversation.getBookmark().getNick(); + && !conversation.getBookmark().getNick().trim().isEmpty()) { + return conversation.getBookmark().getNick().trim(); } else if (!conversation.getJid().isBareJid()) { return conversation.getJid().getResourcepart(); } else { |