diff options
Diffstat (limited to 'telegram/utils.go')
-rw-r--r-- | telegram/utils.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index b22f156..9370839 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -593,7 +593,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return "<empty message>" } - markupFunction := c.getFormatter() + markupMode := c.getFormatter() switch message.Content.MessageContentType() { case client.TypeMessageSticker: sticker, _ := message.Content.(*client.MessageSticker) @@ -646,7 +646,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( photo.Caption.Text, photo.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageAudio: @@ -657,7 +657,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( audio.Caption.Text, audio.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageVideo: @@ -668,7 +668,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( video.Caption.Text, video.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageDocument: @@ -679,7 +679,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( document.Caption.Text, document.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageText: @@ -690,7 +690,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( text.Text.Text, text.Text.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageVoiceNote: @@ -701,7 +701,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( voice.Caption.Text, voice.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageVideoNote: @@ -714,7 +714,7 @@ func (c *Client) messageToText(message *client.Message, preview bool) string { return formatter.Format( animation.Caption.Text, animation.Caption.Entities, - markupFunction, + markupMode, ) } case client.TypeMessageContact: @@ -1500,8 +1500,8 @@ func (c *Client) hasLastMessageHashChanged(chatId, messageId int64, content clie return !ok || oldHash != newHash } -func (c *Client) getFormatter() func(*client.TextEntity) (*formatter.Insertion, *formatter.Insertion) { - return formatter.EntityToXEP0393 +func (c *Client) getFormatter() formatter.MarkupModeType { + return formatter.MarkupModeXEP0393 } func (c *Client) usernamesToString(usernames []string) string { |