mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
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
2 changed files with 8 additions and 1 deletions
1
changelog.d/6529.feature
Normal file
1
changelog.d/6529.feature
Normal file
|
@ -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?) =
|
||||
room.roomSummary()
|
||||
?.takeIf { canNotifyEveryone() }
|
||||
?.takeIf { query.isNullOrBlank() || MatrixItem.NOTIFY_EVERYONE.startsWith("@$query") }
|
||||
?.takeIf {
|
||||
query.isNullOrBlank() ||
|
||||
SUGGEST_ROOM_KEYWORDS.any {
|
||||
it.startsWith("@$query")
|
||||
}
|
||||
}
|
||||
?.let {
|
||||
AutocompleteMemberItem.Everyone(it)
|
||||
}
|
||||
|
@ -165,6 +170,7 @@ class AutocompleteMemberPresenter @AssistedInject constructor(
|
|||
companion object {
|
||||
private const val ID_HEADER_MEMBERS = "ID_HEADER_MEMBERS"
|
||||
private const val ID_HEADER_EVERYONE = "ID_HEADER_EVERYONE"
|
||||
private val SUGGEST_ROOM_KEYWORDS = setOf(MatrixItem.NOTIFY_EVERYONE, "@channel", "@everyone", "@here")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue