aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-profile.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-profile.el')
-rw-r--r--lisp/mastodon-profile.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index 46a56f6..b96caa0 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -146,15 +146,16 @@ This variable is set from data in
(mastodon-tl--property 'item-json))
(defun mastodon-profile--make-author-buffer
- (account &optional no-reblogs no-replies only-media tag)
+ (account &optional no-reblogs no-replies only-media tag max-id)
"Take an ACCOUNT json and insert a user account into a new buffer.
NO-REBLOGS means do not display boosts in statuses.
NO-REPLIES means to exlude replies.
ONLY-MEDIA means show only posts containing attachments.
-TAG is a hashtag to restrict posts to."
+TAG is a hashtag to restrict posts to.
+MAX-ID is a flag to include the max_id pagination parameter."
(mastodon-profile--make-profile-buffer-for
account "statuses" #'mastodon-tl--timeline no-reblogs nil
- no-replies only-media tag))
+ no-replies only-media tag max-id))
;; TODO: we shd just load all views' data then switch coz this is slow af:
(defun mastodon-profile--account-view-cycle ()
@@ -594,15 +595,20 @@ FIELDS means provide a fields vector fetched by other means."
(defun mastodon-profile--make-profile-buffer-for
(account endpoint-type update-function
- &optional no-reblogs headers no-replies only-media tag)
+ &optional no-reblogs headers no-replies only-media tag max-id)
"Display profile of ACCOUNT, using ENDPOINT-TYPE and UPDATE-FUNCTION.
NO-REBLOGS means do not display boosts in statuses.
HEADERS means also fetch link headers for pagination.
NO-REPLIES means to exlude replies.
ONLY-MEDIA means show only posts containing attachments.
-TAG is a hashtag to restrict posts to."
+TAG is a hashtag to restrict posts to.
+MAX-ID is a flag to include the max_id pagination parameter."
(let-alist account
- (let* ((args `(("limit" . ,mastodon-tl--timeline-posts-count)))
+ (let* ((max-id-str (when max-id
+ (mastodon-tl--buffer-property 'max-id)))
+ (args `(("limit" . ,mastodon-tl--timeline-posts-count)
+ ,(when max-id
+ `("max_id" . ,max-id-str))))
(args (cond (no-reblogs
(push '("exclude_reblogs" . "t") args))
(no-replies
@@ -637,9 +643,8 @@ TAG is a hashtag to restrict posts to."
(mastodon-profile-mode)
(remove-overlays)
(setq mastodon-profile--account account)
- (mastodon-tl--set-buffer-spec buffer endpoint
- update-function link-header
- args)
+ (mastodon-tl--set-buffer-spec buffer endpoint update-function
+ link-header args nil max-id-str)
(let* ((inhibit-read-only t)
(is-statuses (string= endpoint-type "statuses"))
(is-followers (string= endpoint-type "followers"))
@@ -748,12 +753,14 @@ the format \"2000-01-31T00:00:00.000Z\"."
(format-time-string "Joined: %d %B %Y"
(parse-iso8601-time-string joined)))
-(defun mastodon-profile--get-toot-author ()
+(defun mastodon-profile--get-toot-author (&optional max-id)
"Open profile of author of toot under point.
-If toot is a boost, opens the profile of the booster."
+If toot is a boost, opens the profile of the booster.
+MAX-ID is a flag to include the max_id pagination parameter."
(interactive)
(mastodon-profile--make-author-buffer
- (alist-get 'account (mastodon-profile--item-json))))
+ (alist-get 'account (mastodon-profile--item-json))
+ nil nil nil nil max-id))
(defun mastodon-profile--image-from-account (account img-type)
"Return a avatar image from ACCOUNT.