mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
EmojiStore: Include short name when searching for emojis
This adds the "common" short name to the list of strings to match the search text against. Previously, only the "other" short names were included in the comparison. This causes an issue for certain emojis like, for instance, the "Hundred Points Symbol" where the term "100" is *only* included in the common short name. As a result, the emoji did not previously show up when searching for "100". Note that as a side effect, searching for "2" will now also return things such as the "dog2" emoji. This matches the behavior in the Element Android app and also in the emoji-mart Node.js package. Closes: #4063 Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
@@ -43,6 +43,10 @@ final class EmojiStore {
|
||||
|
||||
// Do not use `String.localizedCaseInsensitiveContains` here as EmojiItem data is not localized for the moment
|
||||
|
||||
if emojiItem.shortName.vc_caseInsensitiveContains(searchText) {
|
||||
return true
|
||||
}
|
||||
|
||||
if emojiItem.name.vc_caseInsensitiveContains(searchText) {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user