Commit 08534cef authored by Rasmus Pank Roulund's avatar Rasmus Pank Roulund Committed by Katsumi Yamaoka
Browse files

lisp/gnus/gnus-notifications: Raise frame when clicking Read; Add mark as read

parent 0f2fd560
2015-03-08 Rasmus Pank Roulund <rasmus@pank.eu>
* gnus-notifications.el (gnus-notifications-action): Raise window
frame.
(gnus-notifications-action): Allow mark as read.
(gnus-notifications-notify): Show uption to mark as read.
2015-03-08 Adam Sjøgren <asjo@koldfront.dk>
 
* message.el (message-insert-formatted-citation-line): Change %F to
......
......@@ -75,12 +75,19 @@ not get notifications."
"Map notifications ids to messages.")
(defun gnus-notifications-action (id key)
(when (string= key "read")
(let ((group-article (assoc id gnus-notifications-id-to-msg)))
(when group-article
(let ((group (cadr group-article))
(article (nth 2 group-article)))
(gnus-fetch-group group (list article)))))))
(let ((group-article (assoc id gnus-notifications-id-to-msg)))
(when group-article
(let ((group (cadr group-article))
(article (nth 2 group-article)))
(cond ((string= key "read")
(gnus-fetch-group group (list article))
(when (and window-system (fboundp 'x-focus-frame)) (x-focus-frame (selected-frame))))
((string= key "mark-read")
(gnus-update-read-articles
group
(delq article (gnus-list-of-unread-articles group)))
;; gnus-group-refresh-group
(gnus-group-update-group group)))))))
(defun gnus-notifications-notify (from subject photo-file)
"Send a notification about a new mail.
......@@ -90,7 +97,7 @@ Return a notification id if any, or t on success."
'notifications-notify
:title from
:body subject
:actions '("read" "Read")
:actions '("read" "Read" "mark-read" "Mark As Read")
:on-action 'gnus-notifications-action
:app-icon (gnus-funcall-no-warning
'image-search-load-path "gnus/gnus.png")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment