Fix frowning face emoji-only message detection

Change-Id: I9f1d41406feef32d5b83f73ef5759800981ccfbd
This commit is contained in:
SpiritCroc 2022-11-02 09:10:41 +01:00
parent 6c5e72a695
commit 6a3d000be5

View File

@ -38,7 +38,8 @@ fun containsOnlyEmojis(str: String?): Boolean {
// Now rely on vanniktech library
// 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 str?.replace("\ufe0f", "").isOnlyEmojis()
// However, use the old check as well since the "white frowning face" emoji gets lost otherwise...?
return str.isOnlyEmojis() || str?.replace("\ufe0f", "").isOnlyEmojis()
}
/**