From 56a48ad52e1ba3c2ee081545ad13b42ba7b4b981 Mon Sep 17 00:00:00 2001 From: Zajcev Evgeny Date: Sun, 2 Feb 2020 00:59:24 +0300 Subject: [PATCH] Important chats also includes chats with mentions --- telega-customize.el | 2 +- telega-root.el | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/telega-customize.el b/telega-customize.el index 2875db0b..9e787fe8 100644 --- a/telega-customize.el +++ b/telega-customize.el @@ -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." diff --git a/telega-root.el b/telega-root.el index 293a1598..f78e0120 100644 --- a/telega-root.el +++ b/telega-root.el @@ -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)}}} @@ -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."