Skip to content

Commit

Permalink
More support for TDLib 1.8.44 features
Browse files Browse the repository at this point in the history
- [add] Support for `emojiStatusTypeUpgradedGift`

- docs update, fixes https://t.me/emacs_telega/47704
  • Loading branch information
zevlg committed Feb 10, 2025
1 parent 85ad171 commit cfeaf8b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 51 deletions.
26 changes: 13 additions & 13 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/telega-manual.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#+options: timestamp:nil \n:t num:nil ellit-cid:t
#+title: Telega Manual (v0.8.420)
#+title: Telega Manual (v0.8.441)
#+author: Zajcev Evgeny
#+startup: showall

Expand Down Expand Up @@ -244,7 +244,7 @@ Thanks to [[https://t.me/ritsch_master][=@ritsch_master=]]

[[https://core.telegram.org/tdlib][TDLib]] is the library for building Telegram clients. It requires a
large amount of memory to be built. Make sure you are using TDLib
version equal to v1.8.39-056963e48.
version equal to v1.8.44-28c6f2e9c.

On MacOS you can install a pre-built =TDLib= package using homebrew
from [[https://brew.sh][brew.sh]]. Just run:
Expand Down
32 changes: 15 additions & 17 deletions telega-emoji.el
Original file line number Diff line number Diff line change
Expand Up @@ -425,23 +425,21 @@ Do not fetch custom emojis for ignored messages."

(defun telega-emoji-status--image (emoji-status &optional _ignoredfile)
"Return image for the user's EMOJI-STATUS."
(let ((es-type (plist-get emoji-status :type)))
(cl-ecase (telega--tl-type es-type)
(emojiStatusTypeCustomEmoji
(let* ((custom-emoji-id (plist-get es-type :custom_emoji_id))
(sticker (telega-custom-emoji-get custom-emoji-id)))
(if sticker
(telega-sticker--image sticker)

(telega--getCustomEmojiStickers (list custom-emoji-id)
(lambda (stickers)
(seq-doseq (custom-emoji stickers)
(telega-custom-emoji--ensure custom-emoji))))
(telega-etc-file-create-image "symbols/premium.svg" 2))))

(emojiStatusTypeUpgradedGift
;; TODO
))))
(let* ((es-type (plist-get emoji-status :type))
(custom-emoji-id (cl-ecase (telega--tl-type es-type)
(emojiStatusTypeCustomEmoji
(plist-get es-type :custom_emoji_id))
(emojiStatusTypeUpgradedGift
(plist-get es-type :model_custom_emoji_id))))
(sticker (telega-custom-emoji-get custom-emoji-id)))
(if sticker
(telega-sticker--image sticker)

(telega--getCustomEmojiStickers (list custom-emoji-id)
(lambda (stickers)
(seq-doseq (custom-emoji stickers)
(telega-custom-emoji--ensure custom-emoji))))
(telega-etc-file-create-image "symbols/premium.svg" 2))))

(defun telega-ins--emoji-status (emoji-status)
"Inserter for the EMOJI-STATUS."
Expand Down
30 changes: 18 additions & 12 deletions telega-msg.el
Original file line number Diff line number Diff line change
Expand Up @@ -2182,22 +2182,28 @@ be added."
'update-recent-reactions))))
(with-telega-help-win "*Telegram Custom Reaction*"
(unless (seq-empty-p top-av-reactions)
(telega-ins "TOP:\n")
(telega-ins--available-reaction-list
top-av-reactions reaction-type-action)
(telega-ins "\n\n"))
(telega-ins--with-face 'telega-describe-item-title
(telega-ins "TOP:\n"))
(telega-ins--line-wrap-prefix " "
(telega-ins--available-reaction-list
top-av-reactions reaction-type-action)
(telega-ins "\n\n")))

(unless (seq-empty-p recent-av-reactions)
(telega-ins "RECENT:\n")
(telega-ins--available-reaction-list
recent-av-reactions reaction-type-action)
(telega-ins "\n\n"))
(telega-ins--with-face 'telega-describe-item-title
(telega-ins "RECENT:\n"))
(telega-ins--line-wrap-prefix " "
(telega-ins--available-reaction-list
recent-av-reactions reaction-type-action)
(telega-ins "\n\n")))

(unless (seq-empty-p popular-av-reactions)
(telega-ins "POPULAR:\n")
(telega-ins--available-reaction-list
popular-av-reactions reaction-type-action)
(telega-ins "\n\n"))
(telega-ins--with-face 'telega-describe-item-title
(telega-ins "POPULAR:\n"))
(telega-ins--line-wrap-prefix " "
(telega-ins--available-reaction-list
popular-av-reactions reaction-type-action)
(telega-ins "\n\n")))

(telega-ins--custom-emoji-stickersets
(lambda (sticker)
Expand Down
16 changes: 9 additions & 7 deletions telega-webpage.el
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ Keymap:
(telega-webpage--ins-rt (plist-get pb :subheader))
(telega-ins "\n")))
(pageBlockParagraph
(telega-ins "\n")
(unless (looking-back "\n\n")
(telega-ins "\n"))
(telega-webpage--ins-rt (plist-get pb :text)))
(pageBlockPreformatted
(telega-ins "\n")
Expand Down Expand Up @@ -431,12 +432,13 @@ Keymap:
(telega-webpage--ins-rt credit-rt))))
(telega-ins "\n")))
(pageBlockPullQuote
(telega-ins "\u00A0\u00A0")
(telega-ins--with-attrs (list :fill 'center
:fill-column (- telega-webpage-fill-column 2)
:fill-prefix "\u00A0\u00A0")
(telega-webpage--ins-rt (plist-get pb :text)))
(telega-ins "\n"))
(telega-ins-from-newline
(telega-ins "\u00A0\u00A0")
(telega-ins--with-attrs (list :fill 'center
:fill-column (- telega-webpage-fill-column 2)
:fill-prefix "\u00A0\u00A0")
(telega-webpage--ins-rt (plist-get pb :text)))
(telega-ins "\n")))
(pageBlockAnimation
(telega-webpage--ins-animation (plist-get pb :animation))
(telega-ins "\n"))
Expand Down

0 comments on commit cfeaf8b

Please sign in to comment.