aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-notifications.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-19 13:48:05 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-19 13:48:05 +0100
commit61024cb96750f11ade4c42f872f3d6b44f53423b (patch)
treeef10cf09983a1ce068fe43de75a82117233f5d16 /lisp/mastodon-notifications.el
parent4ca74a8142ca78f8b5332825f134a442103bbcf0 (diff)
notifs--get: switch and update if we already have the buffer
Diffstat (limited to 'lisp/mastodon-notifications.el')
-rw-r--r--lisp/mastodon-notifications.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 24a8492..b23e3c5 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -273,13 +273,17 @@ of the toot responded to."
"Display NOTIFICATIONS in buffer.
Optionally only print notifications of type TYPE, a string."
(interactive)
- (message "Loading your notifications...")
- (mastodon-tl--init-sync
- (or buffer-name "notifications")
- "notifications"
- 'mastodon-notifications--timeline
- type)
- (use-local-map mastodon-notifications--map))
+ (let ((buffer "*mastodon-notifications*"))
+ (if (get-buffer buffer)
+ (progn (switch-to-buffer buffer)
+ (mastodon-tl--update))
+ (message "Loading your notifications...")
+ (mastodon-tl--init-sync
+ (or buffer-name "notifications")
+ "notifications"
+ 'mastodon-notifications--timeline
+ type)
+ (use-local-map mastodon-notifications--map))))
(defun mastodon-notifications--get-mentions ()
"Display mention notifications in buffer."