Fix detection of some emojis for emoji-only messages

Change-Id: Ie22d90c39091a85736260672db7413fdfd45f7c4
This commit is contained in:
SpiritCroc 2021-11-15 18:04:55 +01:00
parent 1bd59e3c1c
commit 4248ec163f

View file

@ -28,7 +28,9 @@ import com.vanniktech.emoji.EmojiUtils
*/
fun containsOnlyEmojis(str: String?): Boolean {
// Now rely on vanniktech library
return EmojiUtils.isOnlyEmojis(str)
// Emojis sent from desktop such as thumbs-up or down are sent with a variant selection symbol "\ufe0f",
// that the library identifies as non-emoji character, so remove that manually before.
return EmojiUtils.isOnlyEmojis(str?.replace("\ufe0f", ""))
}
/**