Issue description
Currently, the telega-ins--animated-emoji-msg function ignores the telega-emoji-use-images variable setting when handling messages with only one emoji as content. Even when telega-emoji-use-images is set to nil, animated emojis are still rendered as SVG images instead of plain unicode text.
When a user sends a message with only one emoji, it will be rendered as an SVG image (handled by telega-ins--animated-emoji-msg function). If a user sends the message containing both text and emoji, then it renders as unicode emoji as expected, in context when telega-emoji-use-images is set to nil.
Expected behavior
When telega-emoji-use-images is set to nil, all emojis (including those in animated emoji messages) should be displayed as plain unicode text characters.
Proposed solution
Add a condition to check the value of telega-emoji-use-images in the telega-ins--animated-emoji-msg function before deciding how to render the emoji:
;; Check if emoji images should be used
(if (not telega-emoji-use-images)
;; If emoji images disabled, just insert as text
(telega-ins emoji)
original function:
|
(defun telega-ins--animated-emoji-msg (msg) |
|
"Inserter for the \"messageAnimatedEmoji\" MSG." |
|
(let* ((content (plist-get msg :content)) |
|
(emoji (telega-tl-str content :emoji)) |
|
(animated-emoji (plist-get content :animated_emoji)) |
|
(sticker (plist-get animated-emoji :sticker)) |
|
(fs-sticker (plist-get msg :telega-sticker-fullscreen))) |
|
(when (and fs-sticker |
|
(plist-get fs-sticker :telega-ffplay-frame-filename)) |
|
(setq sticker fs-sticker)) |
|
;; NOTE: sticker might be nil if yet unknown for a custom emoji. |
|
;; In this case we insert emoji instead |
|
(if sticker |
|
(telega-ins--sticker-image sticker 'slices) |
|
(telega-ins emoji)))) |
Issue description
Currently, the
telega-ins--animated-emoji-msgfunction ignores thetelega-emoji-use-imagesvariable setting when handling messages with only one emoji as content. Even whentelega-emoji-use-imagesis set tonil, animated emojis are still rendered as SVG images instead of plain unicode text.When a user sends a message with only one emoji, it will be rendered as an SVG image (handled by
telega-ins--animated-emoji-msgfunction). If a user sends the message containing both text and emoji, then it renders as unicode emoji as expected, in context whentelega-emoji-use-imagesis set tonil.Expected behavior
When
telega-emoji-use-imagesis set tonil, all emojis (including those in animated emoji messages) should be displayed as plain unicode text characters.Proposed solution
Add a condition to check the value of
telega-emoji-use-imagesin thetelega-ins--animated-emoji-msgfunction before deciding how to render the emoji:original function:
telega.el/telega-ins.el
Lines 1575 to 1589 in ff06f58