From 285da114e7c7997df8b0a9a93d5ed7009726c363 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 20 Jun 2019 17:27:15 +0200 Subject: [PATCH] better code (ganfra's review) --- .../android/api/session/room/timeline/TimelineEvent.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt index 58cc8eca30..c05bd138e3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt @@ -56,13 +56,13 @@ data class TimelineEvent( fun getDisambiguatedDisplayName(): String { return if (isUniqueDisplayName) { - senderName ?: root.senderId + senderName } else { - senderName?.let { - it + " (" + root.senderId + ")" + senderName?.let { name -> + "$name (${root.senderId})" } - ?: root.senderId } + ?: root.senderId ?: "" }