mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-28 15:38:14 +08:00
Exclude current user from the list of user to invite (#3123)
This commit is contained in:
parent
cf69d5c882
commit
7309fa547b
@ -109,29 +109,31 @@ class UserListController @Inject constructor(private val session: Session,
|
||||
}
|
||||
|
||||
private fun buildKnownUsers(currentState: UserListViewState, selectedUsers: List<String>) {
|
||||
currentState.knownUsers()?.let { userList ->
|
||||
userListHeaderItem {
|
||||
id("known_header")
|
||||
header(stringProvider.getString(R.string.direct_room_user_list_known_title))
|
||||
}
|
||||
currentState.knownUsers()
|
||||
?.filter { it.userId != session.myUserId }
|
||||
?.let { userList ->
|
||||
userListHeaderItem {
|
||||
id("known_header")
|
||||
header(stringProvider.getString(R.string.direct_room_user_list_known_title))
|
||||
}
|
||||
|
||||
if (userList.isEmpty()) {
|
||||
renderEmptyState()
|
||||
return
|
||||
}
|
||||
userList.forEach { item ->
|
||||
val isSelected = selectedUsers.contains(item.userId)
|
||||
userDirectoryUserItem {
|
||||
id(item.userId)
|
||||
selected(isSelected)
|
||||
matrixItem(item.toMatrixItem())
|
||||
avatarRenderer(avatarRenderer)
|
||||
clickListener { _ ->
|
||||
callback?.onItemClick(item)
|
||||
if (userList.isEmpty()) {
|
||||
renderEmptyState()
|
||||
return
|
||||
}
|
||||
userList.forEach { item ->
|
||||
val isSelected = selectedUsers.contains(item.userId)
|
||||
userDirectoryUserItem {
|
||||
id(item.userId)
|
||||
selected(isSelected)
|
||||
matrixItem(item.toMatrixItem())
|
||||
avatarRenderer(avatarRenderer)
|
||||
clickListener { _ ->
|
||||
callback?.onItemClick(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildDirectoryUsers(directoryUsers: List<User>, selectedUsers: List<String>, searchTerms: String, ignoreIds: List<String>) {
|
||||
|
Loading…
Reference in New Issue
Block a user