branch: elpa/mastodon
commit 0f62e40e5599468d4e3ead0641f9377c763476cf
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <[email protected]>
rough go at a notifs timer. in mastodon-mode-hook for now.
---
lisp/mastodon-notifications.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index f7b5d4e887..7ea3261091 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -990,11 +990,14 @@ NOTE means to include a profile note."
(defun mastodon-notifications-update-check ()
"Function called by `mastodon-notifications-update-with-timer'.
Calls `mastodon-tl--update'."
- (when (mastodon-tl--buffer-type-eq 'notifications)
- ;; run updates if in notifs buffer:
- (mastodon-tl--update))
- ;; set new timer:
- (mastodon-notifications-update-with-timer))
+ (let ((count (mastodon-notifications--get-unread-count)))
+ (when (> 0 count)
+ (if (mastodon-tl--buffer-type-eq 'notifications)
+ ;; run updates if in notifs buffer:
+ (mastodon-tl--update)
+ (message "New mastodon.el notification(s)"))
+ ;; set new timer:
+ (mastodon-notifications-update-with-timer))))
(add-hook 'mastodon-mode-hook
#'mastodon-notifications-update-with-timer)