diff --git a/changelog.d/6529.feature b/changelog.d/6529.feature new file mode 100644 index 0000000000..dc51d1dad0 --- /dev/null +++ b/changelog.d/6529.feature @@ -0,0 +1 @@ +Suggest @room when @channel, @everyone, or @here is typed in composer \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt b/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt index a480b1c279..ff04a4db17 100644 --- a/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt +++ b/vector/src/main/java/im/vector/app/features/autocomplete/member/AutocompleteMemberPresenter.kt @@ -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") } }