Add support for sending user emoji using autocomplete (#205)
authorEmi <emi@alchemi.dev>
Tue, 28 Dec 2021 03:29:39 +0000 (22:29 -0500)
committerGitHub <noreply@github.com>
Tue, 28 Dec 2021 03:29:39 +0000 (08:59 +0530)
commit90621bb1e3c331326684440368120601e766442a
tree74a18549f72b4e888c552709c23fc1835587651b
parent6ff339b552e242f6233abd86768bb2373b150f77
Add support for sending user emoji using autocomplete (#205)

* Add support for sending user emoji using autocomplete

What's included:
- An implementation for detecting user emojis
- Addition of user emojis to the emoji autocomplete in the command bar
- Translation of shortcodes into image tags on message sending

What's not included:
- Loading emojis from the active room, loading the user's global emoji packs, loading emoji from spaces
- Selecting custom emoji using the emoji picker

This is a predominantly proof-of-concept change, and everything here may be subject to
architectural review and reworking.

* Amending PR:  Allow sending multiple of the same emoji

* Amending PR:  Add support for emojis in edited messages

* Amend PR:  Apply requested revisions

This commit consists of several small changes, including:
- Fix crash when the user doesn't have the im.ponies.user_emotes account data entry
- Add mx-data-emoticon attribute to command bar emoji
- Rewrite alt text in the command bar interface
- Remove "vertical-align" attribute from sent emoji

* Amending PR:  Fix bugs (listed below)

- Fix bug where sending emoji w/ markdown off resulted in a crash
- Fix bug where alt text in the command bar was wrong

* Amending PR:  Add support for replacement of twemoji shortcodes

* Amending PR: Fix & refactor getAllEmoji -> getShortcodeToEmoji

* Amending PR: Fix bug: Sending two of the same emoji corrupts message

* Amending PR:  Stylistic fixes
src/app/organisms/emoji-board/custom-emoji.js [new file with mode: 0644]
src/app/organisms/room/RoomViewCmdBar.jsx
src/client/state/RoomsInput.js