aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities/Conversation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Conversation.java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index 8003759d..4801fe12 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -149,11 +149,19 @@ public class Conversation extends AbstractEntity {
}
public String getName() {
- if (getMode() == MODE_MULTI && getMucOptions().getSubject() != null) {
- return getMucOptions().getSubject();
- } else if (getMode() == MODE_MULTI && bookmark != null
- && bookmark.getName() != null) {
- return bookmark.getName();
+ if (getMode() == MODE_MULTI) {
+ if (getMucOptions().getSubject() != null) {
+ return getMucOptions().getSubject();
+ } else if (bookmark != null && bookmark.getName() != null) {
+ return bookmark.getName();
+ } else {
+ String generatedName = getMucOptions().createNameFromParticipants();
+ if (generatedName != null) {
+ return generatedName;
+ } else {
+ return getContactJid().getLocalpart();
+ }
+ }
} else {
return this.getContact().getDisplayName();
}