aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-13 12:17:24 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-13 12:17:24 +0200
commit946758ebf2fb9ffc8773c2fa072c79fea143d24c (patch)
tree9198d0a08eb350f93f3fb5f732b4b6062101eec0 /lisp
parentf268afe2d4e00482fc7612d312eb7a744bd8eb7b (diff)
parent154d984a7af43b5e0caa9f3df7ca49f0def1dab1 (diff)
Merge branch 'develop' into update-meta-fields
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el12
-rw-r--r--lisp/mastodon-toot.el15
2 files changed, 17 insertions, 10 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 8e75705..4726d29 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -647,7 +647,9 @@ START and END are the boundaries of the link in the toot."
keymap
(help-echo (get-text-property start 'help-echo))
extra-properties
- (toot-url (mastodon-tl--field 'url toot))
+ ;; handle calling this on non-toots, e.g. for profiles:
+ (toot-url (when (proper-list-p toot)
+ (mastodon-tl--field 'url toot)))
(toot-url (when toot-url (url-generic-parse-url toot-url)))
(toot-instance-url (if toot-url
(concat (url-type toot-url) "://"
@@ -1700,7 +1702,13 @@ For use after e.g. deleting a toot."
(mastodon-notifications--get))
((equal (mastodon-tl--buffer-name)
(concat "*mastodon-" (mastodon-auth--get-account-name) "-statuses*"))
- (mastodon-profile--my-profile))))
+ (mastodon-profile--my-profile))
+ ((save-match-data
+ (string-match
+ "statuses/\\(?2:[[:digit:]]+\\)/context"
+ (mastodon-tl--get-endpoint))
+ (mastodon-tl--thread
+ (match-string 2 (mastodon-tl--get-endpoint)))))))
(defun mastodon-tl--more ()
"Append older toots to timeline, asynchronously."
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 2f58bfb..5ec58dd 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -462,14 +462,13 @@ REPLY-ID, TOOT-VISIBILITY, and TOOT-CW of deleted toot are preseved."
(defun mastodon-toot--kill (&optional cancel)
"Kill `mastodon-toot-mode' buffer and window.
CANCEL means the toot was not sent, so we save the toot text as a draft."
- (with-current-buffer (get-buffer "*new toot*")
- (unless (eq mastodon-toot-current-toot-text nil)
- (when cancel
- (cl-pushnew mastodon-toot-current-toot-text
- mastodon-toot-draft-toots-list :test 'equal)))
- ;; prevent some weird bug when cancelling a non-empty toot:
- (delete #'mastodon-toot-save-toot-text after-change-functions)
- (kill-buffer-and-window)))
+ (unless (eq mastodon-toot-current-toot-text nil)
+ (when cancel
+ (cl-pushnew mastodon-toot-current-toot-text
+ mastodon-toot-draft-toots-list :test 'equal)))
+ ;; prevent some weird bug when cancelling a non-empty toot:
+ (delete #'mastodon-toot-save-toot-text after-change-functions)
+ (kill-buffer-and-window))
(defun mastodon-toot--cancel ()
"Kill new-toot buffer/window. Does not POST content to Mastodon.