Suggest @room when @channel, @everyone, or @here is typed in composer (#6529)
Signed-off-by: Prat T <pt2121@users.noreply.github.com>
This commit is contained in:
parent
bddb37ef7a
commit
6917e97f49
|
@ -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