Skip to content

Commit

Permalink
Use the right anchor emoji for SAS verification (#3534)
Browse files Browse the repository at this point in the history
Currently, the anchor emoji has a ["Variation
Selector-16"](https://codepoints.net/U+FE0F) (U+FE0F) character after it.

The unicode specs do define U+2694 U+FE0F as a valid sequence (with suggested
rendering https://www.unicode.org/cgi-bin/varglyph?24-2693-FE0F), but our spec
spec doesn't include the variation selector, and the difference means that my
cypress tests (which attempt a verification between Element-R and unrusty
Element Web) fail intermittently.

Something of a follow-up to
#3523, but hopefully this will
be the last, because I have regenerated the whole list from the spec data.
  • Loading branch information
richvdh committed Jun 29, 2023
1 parent 722debe commit c271e15
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/crypto/verification/SAS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,22 @@ const newMismatchedSASError = errorFactory("m.mismatched_sas", "Mismatched short

const newMismatchedCommitmentError = errorFactory("m.mismatched_commitment", "Mismatched commitment");

// This list was generated from the data in the Matrix specification [1] with the following command:
//
// jq -r '.[] | " [\"" + .emoji + "\", \"" + (.description|ascii_downcase) + "\"], // " + (.number|tostring)' sas-emoji.json
//
// [1]: https://github.com/matrix-org/matrix-spec/blob/main/data-definitions/sas-emoji.json
const emojiMapping: EmojiMapping[] = [
["🐢", "dog"], // 0
["🐱", "cat"], // 1
["🦁", "lion"], // 2
["🐎", "horse"], // 3
["πŸ¦„", "unicorn"], // 4
["🐷", "pig"], // 5
["🐘", "elephant"], // 6
["🐰", "rabbit"], // 7
["🐼", "panda"], // 8
["πŸ“", "rooster"], // 9
["🐢", "dog"], // 0
["🐱", "cat"], // 1
["🦁", "lion"], // 2
["🐎", "horse"], // 3
["πŸ¦„", "unicorn"], // 4
["🐷", "pig"], // 5
["🐘", "elephant"], // 6
["🐰", "rabbit"], // 7
["🐼", "panda"], // 8
["πŸ“", "rooster"], // 9
["🐧", "penguin"], // 10
["🐒", "turtle"], // 11
["🐟", "fish"], // 12
Expand Down Expand Up @@ -113,7 +118,7 @@ const emojiMapping: EmojiMapping[] = [
["🎸", "guitar"], // 57
["🎺", "trumpet"], // 58
["πŸ””", "bell"], // 59
["βš“οΈ", "anchor"], // 60
["βš“", "anchor"], // 60
["🎧", "headphones"], // 61
["πŸ“", "folder"], // 62
["πŸ“Œ", "pin"], // 63
Expand Down

0 comments on commit c271e15

Please sign in to comment.