Commit 95ea9692 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Removes unneeded variable.

parent 008f9df4
...@@ -29,16 +29,13 @@ class UserHelper @Inject constructor( ...@@ -29,16 +29,13 @@ class UserHelper @Inject constructor(
* If setting 'Use_Real_Name' is true then the real name will be given, otherwise the username * If setting 'Use_Real_Name' is true then the real name will be given, otherwise the username
* without the '@' is yielded. * without the '@' is yielded.
*/ */
fun displayName(user: SimpleUser): String { fun displayName(user: SimpleUser) = getCurrentServerInteractor.get()?.let {
val displayName: String? = getCurrentServerInteractor.get()?.let { if (settingsRepository.get(it).useRealName()) {
if (settingsRepository.get(it).useRealName()) { user.name
user.name } else {
} else { user.username
user.username
}
} }
return displayName ?: "" }.orEmpty()
}
/** /**
* Whether current [User] is admin on the current server. * Whether current [User] is admin on the current server.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment