From 39a3f372dd7b6d2cd1752c7c755fefe6866bc3c0 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 3 Dec 2014 00:00:25 +0100 Subject: clean up getProposedNick --- src/main/java/eu/siacs/conversations/entities/MucOptions.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index beb9612d..2244645b 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -281,14 +281,13 @@ public class MucOptions { public String getProposedNick() { if (conversation.getBookmark() != null - && conversation.getBookmark().getNick() != null) { + && conversation.getBookmark().getNick() != null + && !conversation.getBookmark().getNick().isEmpty()) { return conversation.getBookmark().getNick(); + } else if (!conversation.getContactJid().isBareJid()) { + return conversation.getContactJid().getResourcepart(); } else { - if (!conversation.getContactJid().isBareJid()) { - return conversation.getContactJid().getResourcepart(); - } else { - return account.getUsername(); - } + return account.getUsername(); } } -- cgit v1.2.3