mu4e-dbus: include delta-unread

Include the delta-unread in the QueryInfo.
This commit is contained in:
Dirk-Jan C. Binnema
2026-07-29 23:37:13 +03:00
committed by Seth Ladygo
parent bb57f7a226
commit 41f999a6bf

View File

@ -1,6 +1,6 @@
;;; mu4e-dbus.el --- DBus support -*- lexical-binding: t-*- ;;; mu4e-dbus.el --- DBus support -*- lexical-binding: t-*-
;; Copyright (C) 2025 Dirk-Jan C. Binnema ;; Copyright (C) 2025-2026 Dirk-Jan C. Binnema
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@ -21,7 +21,7 @@
;; along with mu4e. If not, see <http://www.gnu.org/licenses/>. ;; along with mu4e. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary: ;;; Commentary:
;;; Generic support for showing new-mail notifications. ;;; Export Mu4e information over D-Bus.
;;; Code: ;;; Code:
@ -97,6 +97,7 @@ Apart from the properties boilerplate, the
- query (string) -> query for this item - query (string) -> query for this item
- count (number) -> number of matching messages - count (number) -> number of matching messages
- unread (number) -> the number of unread messages - unread (number) -> the number of unread messages
- delta-unread (number) -> number of unread, since baseline
- favorite (bool) -> this is the favorite entry - favorite (bool) -> this is the favorite entry
(optional, at most one entry has this).") (optional, at most one entry has this).")
@ -160,8 +161,7 @@ setting a property means (re)registering it."
;; Convert to D-Bus format - list of dict entries ;; Convert to D-Bus format - list of dict entries
(defun mu4e--dbus-query-info () (defun mu4e--dbus-query-info ()
"Return an array of dbus vardicts with query-items information. "Return an array of dbus vardicts with query-items information.
this filters / maps the information from `mu4e-query-items'."
This filters / maps the information from `mu4e-query-items'."
;; D-Bus signature: aa{sv} (array of dict with string keys and variant values) ;; D-Bus signature: aa{sv} (array of dict with string keys and variant values)
;; Return an array of dbus vardicts with query-items information. ;; Return an array of dbus vardicts with query-items information.
;; This filters / maps the information from `mu4e-query-items'." ;; This filters / maps the information from `mu4e-query-items'."
@ -172,8 +172,8 @@ This filters / maps the information from `mu4e-query-items'."
(let ((dict)) (let ((dict))
(while plist (while plist
(let* ((key (car plist)) (val (cadr plist))) (let* ((key (car plist)) (val (cadr plist)))
(when (memq key '(:name :query :count :unread :favorite)) (when (memq key '(:name :query :count :unread :delta-unread :favorite))
(push (list :dict-entry (substring (symbol-name key) 1) ; eat ':' (push (list :dict-entry (substring (symbol-name key) 1) ; decolonize
(list :variant val)) dict)) (list :variant val)) dict))
(setq plist (cddr plist)))) (setq plist (cddr plist))))
(cons ':array dict))) (cons ':array dict)))