From c5a3c917712283d733971dba2ad39486f82bb6e4 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 6 May 2021 19:21:29 +0200 Subject: add delete toot function --- lisp/mastodon-tl.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 0b918df..ae21041 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -782,6 +782,17 @@ webapp" (cdr (assoc 'descendants context)))))) (message "No Thread!")))) +(defun mastodon-tl--delete-toot () + "Delete user's toot at point synchronously." + (interactive) + (let* ((id (mastodon-tl--as-string (mastodon-tl--toot-id + (mastodon-tl--property 'toot-json)))) + (url (mastodon-http--api (format "statuses/%s" id)))) + (let ((response (mastodon-http--delete url))) + (mastodon-http--triage response + (lambda () + (message "Toot deleted! There may be a delay before it disappears from your profile.")))))) + (defun mastodon-tl--more () "Append older toots to timeline." (interactive) -- cgit v1.2.3