diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-03-27 12:17:35 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-03-27 12:17:35 +0200 |
commit | 5a3a6dcbadb60e4794733f8e26dc3c8d1f5c187c (patch) | |
tree | 89dba1c78436b2dbe4a36f8c83c8973949a5decb | |
parent | 3a3371d7f98f3097fb2b294b3a409d2a0d0f1bb8 (diff) |
add force arg to notifs-get, and use it in reload-timeline-
-rw-r--r-- | lisp/mastodon-tl.el | 2 | ||||
-rw-r--r-- | lisp/mastodon.el | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 690a98e..d041b2f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2086,7 +2086,7 @@ For use after e.g. deleting a toot." ((mastodon-tl--buffer-type-eq 'local) (mastodon-tl--get-local-timeline)) ((mastodon-tl--buffer-type-eq 'notifications) - (mastodon-notifications-get)) + (mastodon-notifications-get nil nil :force)) ((mastodon-tl--buffer-type-eq 'own-profile) (mastodon-profile--my-profile)) ((save-match-data diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 5f7034e..a78685e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -275,15 +275,18 @@ If REPLY-JSON is the json of the toot being replied to." (mastodon-toot--compose-buffer user reply-to-id reply-json)) ;;;###autoload -(defun mastodon-notifications-get (&optional type buffer-name) +(defun mastodon-notifications-get (&optional type buffer-name force) "Display NOTIFICATIONS in buffer. Optionally only print notifications of type TYPE, a string. -BUFFER-NAME is added to \"*mastodon-\" to create the buffer name." +BUFFER-NAME is added to \"*mastodon-\" to create the buffer name. +FORCE means do not try to update an existing buffer, but fetch +from the server and load anew." (interactive) (let ((buffer (if buffer-name (concat "*mastodon-" buffer-name "*") "*mastodon-notifications*"))) - (if (get-buffer buffer) + (if (and (not force) + (get-buffer buffer)) (progn (switch-to-buffer buffer) (mastodon-tl--update)) (message "Loading your notifications...") |