Skip to content

Commit

Permalink
Important chats also includes chats with mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
zevlg committed Feb 1, 2020
1 parent 527e3b8 commit 56a48ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion telega-customize.el
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ If CHAT-FILTER matches chat, that chat gets CUSTOM-LABEL."
("Groups" . (type basicgroup supergroup))
("Channels" . (type channel))
("Contacts" . contact)
("Important" . (and unread unmuted))
("Important" . (or mention (and unread unmuted)))
("📑Archive" . archive))
"*Alist of custom filters in form (NAME . FILTER).
TODO: If NAME starts with \"lng_\" then `telega-i18n' is used."
Expand Down
11 changes: 7 additions & 4 deletions telega-root.el
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@
;;
;; {{{fundoc(telega-root-next-important)}}}
;;
;; Important message is unseen message in chat with enabled
;; notifications. i.e. matching ~(and unread unmuted)~
;; [[#chat-filters][chat filter]].
;; Important message is the messages matching "Important" custom
;; [[#chat-filters][chat filter]]. If there is no "Important"
;; custom chat filter, then ~(or mention (and unread unmuted))~
;; chat filter is used.
(define-key map (kbd "M-g i") 'telega-root-next-important)

;; - Key: {{{where-is(telega-root-next-mention,telega-root-mode-map)}}}
Expand Down Expand Up @@ -465,7 +466,9 @@ NEW-CHAT-P is used for optimization, to omit ewoc's node search."
(defun telega-root-next-important (n)
"Move point to the next chat with important messages."
(interactive "p")
(telega-root-next-match-p '(and unread unmuted) n))
(let ((important-filter (or (cdr (assoc "Important" telega-filters-custom))
'(or mention (and unread unmuted)))))
(telega-root-next-match-p important-filter n)))

(defun telega-root-next-mention (n)
"Move point to the next chat with mention."
Expand Down

0 comments on commit 56a48ad

Please sign in to comment.