don't use a bookmarks name if it's empty

This commit is contained in:
Daniel Gultsch 2016-06-03 18:43:45 +02:00
parent 17c62b5991
commit e26d842549
2 changed files with 7 additions and 4 deletions

View File

@ -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();
}

View File

@ -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) {