aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-20 22:04:24 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-21 10:04:12 +0100
commitd61ec5793e1866765f4b85e157e20122491b43e9 (patch)
tree97b17034684789384068d0a93aed803157d28462
parentec3821d4a0126d978a052a522ab161a40c689cf3 (diff)
get toot edits
-rw-r--r--lisp/mastodon-toot.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 628a546..069c914 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -728,6 +728,14 @@ instance to edit a toot."
(let ((url (mastodon-http--api (format "/statuses/%s/source" id))))
(mastodon-http--get-json url :silent)))
+(defun mastodon-toot--get-toot-edits ()
+ "Return the edit history of toot at point."
+ (let* ((toot (or (mastodon-tl--property 'base-toot)
+ (mastodon-tl--property 'toot-json)))
+ (id (mastodon-tl--field 'id toot))
+ (url (mastodon-http--api (format "statuses/%s/history" id))))
+ (mastodon-http--get-json url)))
+
(defun mastodon-toot--restore-previous-window-config (config)
"Restore the window CONFIG after killing the toot compose buffer.
Buffer-local variable `mastodon-toot-previous-window-config' holds the config."