X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-notifications.el;h=f73aac1f5b37ce4c3f7295b07bf99ccfff25868a;hb=4fe932c9ab0714252bb9a6de65b139026c41b3ac;hp=1ed344e1c7a8491b4e18c2d5a28f49821329c532;hpb=4c012447d37884c8b8a6f186e02d9ce45b891013;p=gnus diff --git a/lisp/gnus-notifications.el b/lisp/gnus-notifications.el index 1ed344e1c..f73aac1f5 100644 --- a/lisp/gnus-notifications.el +++ b/lisp/gnus-notifications.el @@ -75,13 +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)) - (when (window-system) (x-focus-frame (selected-frame)))))))) + (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)) + (gnus-select-frame-set-input-focus (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. @@ -91,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")