Skip to content

Commit

Permalink
Fetch chat info locally when matching a chat
Browse files Browse the repository at this point in the history
Fixes https://t.me/emacs_telega/47633

Version -> 0.8.441
  • Loading branch information
zevlg committed Feb 3, 2025
1 parent e86431a commit 85ad171
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions telega-match.el
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ LIST-NAME is `main' or `archive' symbol, or string naming Chat Folder."
;; {{{temexdoc(chat, has-linked-chat, 2)}}}
(define-telega-matcher chat has-linked-chat (chat)
"Matches if chat is a supergroup and has a linked chat."
(plist-get (telega-chat--info chat) :has_linked_chat))
(plist-get (telega-chat--info chat 'locally) :has_linked_chat))

;;; ellit-org: chat-temex
;; - has-discussion-group ::
Expand All @@ -574,7 +574,7 @@ LIST-NAME is `main' or `archive' symbol, or string naming Chat Folder."
;; {{{temexdoc(chat, has-location, 2)}}}
(define-telega-matcher chat has-location (chat)
"Matches if chat is a location-based supergroup."
(plist-get (telega-chat--info chat) :has_location))
(plist-get (telega-chat--info chat 'locally) :has_location))

;;; ellit-org: chat-temex
;; - inactive-supergroups , {{{where-is(telega-filter-by-inactive-supergroups,telega-root-mode-map)}}} ::
Expand Down Expand Up @@ -637,14 +637,14 @@ Return auto-deletion timer value."
;; {{{temexdoc(chat, is-broadcast-group, 2)}}}
(define-telega-matcher chat is-broadcast-group (chat)
"Matches if chat is a broadcast group."
(plist-get (telega-chat--info chat) :is_broadcast_group))
(plist-get (telega-chat--info chat 'locally) :is_broadcast_group))

;;; ellit-org: chat-temex
;; - is-forum ::
;; {{{temexdoc(chat, is-forum, 2)}}}
(define-telega-matcher chat is-forum (chat)
"Matches if chat is a forum group."
(plist-get (telega-chat--info chat) :is_forum))
(plist-get (telega-chat--info chat 'locally) :is_forum))

;;; ellit-org: chat-temex
;; - has-sponsored-messages ::
Expand Down Expand Up @@ -714,9 +714,10 @@ By default N is 1."
"Matches if chat has non-expired stories available to you.
If UNREAD-P is non-nil then match only if there is at least one unread
non-expired story."
(plist-get (telega-chat--info chat) (if unread-p
:has_unread_active_stories
:has_active_stories)))
(plist-get (telega-chat--info chat 'locally)
(if unread-p
:has_unread_active_stories
:has_active_stories)))

;;; ellit-org: chat-temex
;; - (active-stories-list ~LIST~) ::
Expand Down
4 changes: 2 additions & 2 deletions telega.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
;; Keywords: comm
;; Package-Requires: ((emacs "27.1") (visual-fill-column "1.9") (transient "0.3.0"))
;; URL: https://github.com/zevlg/telega.el
;; Version: 0.8.440
(defconst telega-version "0.8.440")
;; Version: 0.8.441
(defconst telega-version "0.8.441")
(defconst telega-server-min-version "0.7.7")
(defconst telega-tdlib-min-version "1.8.44")
(defconst telega-tdlib-max-version nil)
Expand Down

0 comments on commit 85ad171

Please sign in to comment.