Add support for custom emojis to sanitize()

nolan/hinaloe-test
Jakob Krigovsky 2017-05-26 10:09:42 +02:00
parent 2f7d6eb0d8
commit a28f04326a
1 changed files with 12 additions and 1 deletions

View File

@ -15,10 +15,21 @@ function unifiedToNative(unified) {
}
function sanitize(emoji) {
var { name, short_names, skin_tone, skin_variations, emoticons, unified } = emoji,
var { name, short_names, skin_tone, skin_variations, emoticons, unified, custom, imageUrl } = emoji,
id = short_names[0],
colons = `:${id}:`
if (custom) {
return {
id,
name,
colons,
emoticons,
custom,
imageUrl
}
}
if (skin_tone) {
colons += `:skin-tone-${skin_tone}:`
}