Support animated emoji messages

This commit is contained in:
Bohdan Horbeshko 2022-02-05 10:19:18 -05:00
parent ab1af45247
commit 6f4cd5547a

View file

@ -376,8 +376,8 @@ func (c *Client) formatLocation(location *client.Location) string {
func (c *Client) messageToText(message *client.Message) string { func (c *Client) messageToText(message *client.Message) string {
if message.Content == nil { if message.Content == nil {
log.Warnf("Unknown message (big emoji?): %#v", message) log.Warnf("Unknown message: %#v", message)
return "<BIG EMOJI>" return "<empty message>"
} }
markupFunction := formatter.EntityToXEP0393 markupFunction := formatter.EntityToXEP0393
@ -385,6 +385,9 @@ func (c *Client) messageToText(message *client.Message) string {
case client.TypeMessageSticker: case client.TypeMessageSticker:
sticker, _ := message.Content.(*client.MessageSticker) sticker, _ := message.Content.(*client.MessageSticker)
return sticker.Sticker.Emoji return sticker.Sticker.Emoji
case client.TypeMessageAnimatedEmoji:
animatedEmoji, _ := message.Content.(*client.MessageAnimatedEmoji)
return animatedEmoji.Emoji
case client.TypeMessageBasicGroupChatCreate, client.TypeMessageSupergroupChatCreate: case client.TypeMessageBasicGroupChatCreate, client.TypeMessageSupergroupChatCreate:
return "has created chat" return "has created chat"
case client.TypeMessageChatJoinByLink: case client.TypeMessageChatJoinByLink: