Adding header section only when "@room" is available
This commit is contained in:
parent
11dacbab81
commit
df3fc38054
|
@ -85,10 +85,14 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context,
|
||||||
val membersHeader = createMembersHeader()
|
val membersHeader = createMembersHeader()
|
||||||
val members = createMemberItems(queryParams)
|
val members = createMemberItems(queryParams)
|
||||||
val everyone = createEveryoneItem(query)
|
val everyone = createEveryoneItem(query)
|
||||||
|
// add headers only when user can notify everyone
|
||||||
|
val canAddHeaders = canNotifyEveryone()
|
||||||
|
|
||||||
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
||||||
if (members.isNotEmpty()) {
|
if (members.isNotEmpty()) {
|
||||||
|
if (canAddHeaders) {
|
||||||
add(membersHeader)
|
add(membersHeader)
|
||||||
|
}
|
||||||
addAll(members)
|
addAll(members)
|
||||||
}
|
}
|
||||||
everyone?.let {
|
everyone?.let {
|
||||||
|
|
Loading…
Reference in New Issue