From 4dd84c9d5214369ea6c51cad04148aa067b69f8f Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 4 Oct 2021 12:24:34 +0200 Subject: make updating new toots inserts them after any pinned toots --- lisp/mastodon-profile.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 98d11f7..28f2e46 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -111,7 +111,7 @@ extra keybindings." (mastodon-tl--property 'toot-json)) (defun mastodon-profile--make-author-buffer (account) - "Take a ACCOUNT and insert a user account into a new buffer." + "Take an ACCOUNT json and insert a user account into a new buffer." (mastodon-profile--make-profile-buffer-for account "statuses" #'mastodon-tl--timeline)) @@ -369,8 +369,9 @@ Returns a list of lists." (setq mastodon-tl--update-point (point)) (mastodon-media--inline-images (point-min) (point)) ;; insert pinned toots first - (if (and pinned (equal endpoint-type "statuses")) - (mastodon-profile--insert-statuses-pinned pinned)) + (when (and pinned (equal endpoint-type "statuses")) + (mastodon-profile--insert-statuses-pinned pinned) + (setq mastodon-tl--update-point (point))) ;updates to follow pinned toots (funcall update-function json))) ;;(mastodon-tl--goto-next-toot) (goto-char (point-min)))) -- cgit v1.2.3 From fdd3ea487b6485dd210f5ee99836f900f23823b4 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 5 Oct 2021 18:51:00 +0200 Subject: set a larger mastodon-http--timeout. loading profiles would often not make in 5 seconds on a slower connection --- lisp/mastodon-http.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index abd9af0..bc48e8d 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -42,7 +42,7 @@ (defvar mastodon-http--api-version "v1") -(defconst mastodon-http--timeout 5 +(defconst mastodon-http--timeout 15 "HTTP request timeout, in seconds. Has no effect on Emacs < 26.1.") (defun mastodon-http--api (endpoint) -- cgit v1.2.3 From 3df45c1cd655f3c3555c47d6cfaf023ef13b6ca7 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 5 Oct 2021 18:52:05 +0200 Subject: get relationships for a user with 1 rather than 2 requests --- lisp/mastodon-profile.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 28f2e46..2c364da 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -297,10 +297,11 @@ Returns a list of lists." (toots-count (mastodon-tl--as-string (mastodon-profile--account-field account 'statuses_count))) + (relationships (mastodon-profile--relationships-get id)) (followed-by-you (cdr (assoc 'following - (aref (mastodon-profile--relationships-get id) 0)))) + (aref relationships 0)))) (follows-you (cdr (assoc 'followed_by - (aref (mastodon-profile--relationships-get id) 0)))) + (aref relationships 0)))) (followsp (or (equal follows-you 't) (equal followed-by-you 't))) (fields (mastodon-profile--fields-get account)) (pinned (mastodon-profile--get-statuses-pinned account))) -- cgit v1.2.3