From 18ee21355cda9dfc09e228e0369946d6c45e5aa1 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 11 Feb 2020 11:36:31 +1100 Subject: [PATCH] Clean --- .../securesms/notifications/NotificationUtilities.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationUtilities.kt b/src/org/thoughtcrime/securesms/notifications/NotificationUtilities.kt index 8ff7c636cc..f167226223 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationUtilities.kt +++ b/src/org/thoughtcrime/securesms/notifications/NotificationUtilities.kt @@ -9,14 +9,10 @@ fun getOpenGroupDisplayName(recipient: Recipient, threadRecipient: Recipient, co val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(threadRecipient) val publicChat = DatabaseFactory.getLokiThreadDatabase(context).getPublicChat(threadID) val hexEncodedPublicKey = recipient.address.toString() - val displayName: String? - displayName = if (publicChat != null) { + val displayName = if (publicChat != null) { DatabaseFactory.getLokiUserDatabase(context).getServerDisplayName(publicChat.id, hexEncodedPublicKey) } else { DatabaseFactory.getLokiUserDatabase(context).getDisplayName(hexEncodedPublicKey) } - if (displayName == null) { - return hexEncodedPublicKey - } - return displayName + return displayName ?: hexEncodedPublicKey } \ No newline at end of file