Merge pull request #7000 from pt2121/pt/6529-room
Suggest @room when @channel, @everyone, or @here is typed in composer
This commit is contained in:
commit
59e6fa98c9
|
@ -0,0 +1 @@
|
||||||
|
Suggest @room when @channel, @everyone, or @here is typed in composer
|
|
@ -145,7 +145,12 @@ class AutocompleteMemberPresenter @AssistedInject constructor(
|
||||||
private fun createEveryoneItem(query: CharSequence?) =
|
private fun createEveryoneItem(query: CharSequence?) =
|
||||||
room.roomSummary()
|
room.roomSummary()
|
||||||
?.takeIf { canNotifyEveryone() }
|
?.takeIf { canNotifyEveryone() }
|
||||||
?.takeIf { query.isNullOrBlank() || MatrixItem.NOTIFY_EVERYONE.startsWith("@$query") }
|
?.takeIf {
|
||||||
|
query.isNullOrBlank() ||
|
||||||
|
SUGGEST_ROOM_KEYWORDS.any {
|
||||||
|
it.startsWith("@$query")
|
||||||
|
}
|
||||||
|
}
|
||||||
?.let {
|
?.let {
|
||||||
AutocompleteMemberItem.Everyone(it)
|
AutocompleteMemberItem.Everyone(it)
|
||||||
}
|
}
|
||||||
|
@ -165,6 +170,7 @@ class AutocompleteMemberPresenter @AssistedInject constructor(
|
||||||
companion object {
|
companion object {
|
||||||
private const val ID_HEADER_MEMBERS = "ID_HEADER_MEMBERS"
|
private const val ID_HEADER_MEMBERS = "ID_HEADER_MEMBERS"
|
||||||
private const val ID_HEADER_EVERYONE = "ID_HEADER_EVERYONE"
|
private const val ID_HEADER_EVERYONE = "ID_HEADER_EVERYONE"
|
||||||
|
private val SUGGEST_ROOM_KEYWORDS = setOf(MatrixItem.NOTIFY_EVERYONE, "@channel", "@everyone", "@here")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue