From ac192b47f90bbea9682c4c47c0188d9678665cfc Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 21 Dec 2021 09:41:56 +0100 Subject: override 'O' binding on links to my-profile --- lisp/mastodon-tl.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index c2cfdb2..f1c66a4 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -128,6 +128,8 @@ etc.") ;; version that knows about more types of links. (define-key map [remap shr-next-link] 'mastodon-tl--next-tab-item) (define-key map [remap shr-previous-link] 'mastodon-tl--previous-tab-item) + ;; keep new my-profile binding; shr 'O' doesn't work here anyway + (define-key map (kbd "O") 'mastodon-profile--my-profile) (keymap-canonicalize map)) "The keymap to be set for shr.el generated links that are not images. -- cgit v1.2.3 From 907c8f7e86277d36eb1eac99ba8abe2b848eed57 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 21 Dec 2021 19:23:44 +0100 Subject: remove all ^M from update profile note buffer --- lisp/mastodon-profile.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index e8025ed..98e5090 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -218,6 +218,7 @@ extra keybindings." (mastodon-profile-update-mode t) (insert note) (goto-char (point-min)) + (delete-trailing-whitespace) ; remove all ^M's (message "Edit your profile note. C-c C-c to send, C-c C-k to cancel."))) (defun mastodon-profile--user-profile-send-updated () -- cgit v1.2.3 From a20b072589d6b00bce050978c5bb8d47af5a99fb Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 23 Dec 2021 10:31:09 +0100 Subject: tiny cleanups after Ediff main / master --- lisp/mastodon-tl.el | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index f1c66a4..7e9eb60 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -225,7 +225,7 @@ text, i.e. hidden spoiler text." "Prompts for tag and opens its timeline." (interactive) (let* ((word (or (word-at-point) "")) - (input (read-string (format "Load timeline for tag(%s): " word))) + (input (read-string (format "Load timeline for tag (%s): " word))) (tag (if (equal input "") word input))) (message "Loading timeline for #%s..." tag) (mastodon-tl--show-tag-timeline tag))) @@ -288,12 +288,10 @@ Optionally start from POS." (mastodon-media--get-avatar-rendering avatar-url)) (propertize name 'face 'mastodon-display-name-face - 'help-echo - (mastodon-tl--format-faves-count toot)) - ;; 'help-echo ;; echo faves count when point on post author name: ;; which is where --goto-next-toot puts point. - ;; (mastodon-tl--format-faves-count toot)) + 'help-echo + (mastodon-tl--format-faves-count toot)) " (" (propertize (concat "@" handle) 'face 'mastodon-handle-face @@ -654,7 +652,7 @@ Used for hitting on a given link." (error "Unknown link type %s" link-type))))) (defun mastodon-tl--do-link-action (event) - "Do the action of the link at. + "Do the action of the link at point. Used for a mouse-click EVENT on a link." (interactive "e") (mastodon-tl--do-link-action-at-point (posn-point (event-end event)))) @@ -724,18 +722,17 @@ message is a link which unhides/hides the main body." (defun mastodon-tl--content (toot) "Retrieve text content from TOOT. -If we are in thread view, the toot content is propertized with -faves/boosts/replies counts." +Runs `mastodon-tl--render-text' and fetches poll or media." (let* ((content (mastodon-tl--field 'content toot)) (reblog (alist-get 'reblog toot)) (poll-p (if reblog (alist-get 'poll reblog) (alist-get 'poll toot)))) (concat - (mastodon-tl--render-text content toot) - (when poll-p - (mastodon-tl--get-poll toot)) - (mastodon-tl--media toot)))) + (mastodon-tl--render-text content toot) + (when poll-p + (mastodon-tl--get-poll toot)) + (mastodon-tl--media toot)))) (defun mastodon-tl--insert-status (toot body author-byline action-byline) "Display the content and byline of timeline element TOOT. @@ -763,7 +760,7 @@ takes a single function. By default it is (mastodon-media--inline-images start-pos (point))))) (defun mastodon-tl--get-poll (toot) - "If post TOOT is a poll, return a formatted string of poll." + "If TOOT includes a poll, return it as a formatted string." (let* ((poll (mastodon-tl--field 'poll toot)) (options (mastodon-tl--field 'options poll)) (option-titles (mapcar (lambda (x) @@ -831,7 +828,6 @@ takes a single function. By default it is (url (mastodon-http--api (format "polls/%s/votes" poll-id))) ;; need to zero-index our option: (option-as-arg (number-to-string (1- (string-to-number (car option))))) - ;; (option-indexed (arg `(("choices[]" . ,option-as-arg))) (response (mastodon-http--post url arg nil))) (mastodon-http--triage response -- cgit v1.2.3 From 86d51fd563f3caaaf029cf0df06fffce3d75d8a7 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 23 Dec 2021 10:51:45 +0100 Subject: apply pleroma patch from #208 --- lisp/mastodon-http.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 33182ff..c0fa101 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -113,6 +113,8 @@ Authorization header is included by default unless UNAUTHENTICED-P is non-nil." (append (unless unauthenticed-p `(("Authorization" . ,(concat "Bearer " (mastodon-auth--access-token))))) + (unless (assoc "Content-Type" headers) + '(("Content-Type" . "application/x-www-form-urlencoded"))) headers))) (with-temp-buffer (mastodon-http--url-retrieve-synchronously url)))) -- cgit v1.2.3