diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-19 13:48:05 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-19 13:48:05 +0100 |
commit | 61024cb96750f11ade4c42f872f3d6b44f53423b (patch) | |
tree | ef10cf09983a1ce068fe43de75a82117233f5d16 /lisp/mastodon-notifications.el | |
parent | 4ca74a8142ca78f8b5332825f134a442103bbcf0 (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.el | 18 |
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." |