* gnus-sum.el (gnus-summary-open-group-with-article): New command.
[gnus] / lisp / gnus-notifications.el
index f9c2d30..0621c23 100644 (file)
@@ -1,6 +1,6 @@
 ;; gnus-notifications.el -- Send notification on new message in Gnus
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: news
@@ -42,6 +42,7 @@
 
 (defgroup gnus-notifications nil
   "Send notifications on new message in Gnus."
+  :version "24.3"
   :group 'gnus)
 
 (defcustom gnus-notifications-use-google-contacts t
@@ -63,7 +64,8 @@ not get notifications."
 
 (defcustom gnus-notifications-timeout nil
   "Timeout used for notifications sent via `notifications-notify'."
-  :type 'integer
+  :type '(choice (const :tag "Server default" nil)
+                 (integer :tag "Milliseconds"))
   :group 'gnus-notifications)
 
 (defvar gnus-notifications-sent nil
@@ -90,12 +92,12 @@ Return a notification id if any, or t on success."
        :body subject
        :actions '("read" "Read")
        :on-action 'gnus-notifications-action
-       :app-icon (gnus-funcall-no-warning
-                 'image-search-load-path "gnus/gnus.png")
+       :app-icon (or photo-file
+                     (gnus-funcall-no-warning
+                      'image-search-load-path "gnus/gnus.png"))
        :app-name "Gnus"
        :category "email.arrived"
-       :timeout gnus-notifications-timeout
-       :image-path photo-file)
+       :timeout gnus-notifications-timeout)
     (message "New message from %s: %s" from subject)
     ;; Don't return an id
     t))
@@ -166,8 +168,10 @@ This is typically a function to add in
                                             (or (mail-fetch-field "From") "")))
                        (address (cadr address-components)))
                   ;; Ignore mails from ourselves
-                  (unless (gnus-string-match-p gnus-ignored-from-addresses
-                                               address)
+                  (unless (and gnus-ignored-from-addresses
+                               address
+                               (gnus-string-match-p gnus-ignored-from-addresses
+                                                    address))
                     (let* ((photo-file (gnus-notifications-get-photo-file address))
                            (notification-id (gnus-notifications-notify
                                              (or (car address-components) address)