only add shortcode for custom image reactions

This commit is contained in:
Cadence Ember 2023-09-25 22:21:34 +13:00
parent 6dcf3a383a
commit c3040f19c2

View file

@ -26,6 +26,7 @@ async function addReaction(data) {
assert.equal(typeof parentID, "string") assert.equal(typeof parentID, "string")
const key = await emojiToKey.emojiToKey(data.emoji) const key = await emojiToKey.emojiToKey(data.emoji)
const shortcode = key.startsWith("mxc://") ? `:${data.emoji.name}:` : undefined
const roomID = await createRoom.ensureRoom(data.channel_id) const roomID = await createRoom.ensureRoom(data.channel_id)
const senderMxid = await registerUser.ensureSimJoined(user, roomID) const senderMxid = await registerUser.ensureSimJoined(user, roomID)
@ -35,7 +36,7 @@ async function addReaction(data) {
event_id: parentID, event_id: parentID,
key key
}, },
shortcode: `:${data.emoji.name}:` shortcode
}, senderMxid) }, senderMxid)
return eventID return eventID
} }