Fix small bug about suggestion

This commit is contained in:
Benoit Marty 2021-04-20 19:11:37 +02:00
parent 19e07f6cac
commit cf69d5c882
1 changed files with 11 additions and 11 deletions

View File

@ -135,7 +135,9 @@ class UserListController @Inject constructor(private val session: Session,
} }
private fun buildDirectoryUsers(directoryUsers: List<User>, selectedUsers: List<String>, searchTerms: String, ignoreIds: List<String>) { private fun buildDirectoryUsers(directoryUsers: List<User>, selectedUsers: List<String>, searchTerms: String, ignoreIds: List<String>) {
val toDisplay = directoryUsers.filter { !ignoreIds.contains(it.userId) } val toDisplay = directoryUsers
.filter { !ignoreIds.contains(it.userId) && it.userId != session.myUserId }
if (toDisplay.isEmpty() && searchTerms.isBlank()) { if (toDisplay.isEmpty() && searchTerms.isBlank()) {
return return
} }
@ -147,16 +149,14 @@ class UserListController @Inject constructor(private val session: Session,
renderEmptyState() renderEmptyState()
} else { } else {
toDisplay.forEach { user -> toDisplay.forEach { user ->
if (user.userId != session.myUserId) { val isSelected = selectedUsers.contains(user.userId)
val isSelected = selectedUsers.contains(user.userId) userDirectoryUserItem {
userDirectoryUserItem { id(user.userId)
id(user.userId) selected(isSelected)
selected(isSelected) matrixItem(user.toMatrixItem())
matrixItem(user.toMatrixItem()) avatarRenderer(avatarRenderer)
avatarRenderer(avatarRenderer) clickListener { _ ->
clickListener { _ -> callback?.onItemClick(user)
callback?.onItemClick(user)
}
} }
} }
} }