aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-05-25 11:22:26 +0200
committermousebot <mousebot@riseup.net>2021-05-25 11:22:26 +0200
commitd8121e7447bf30767cd91523e12429a7a934a2c9 (patch)
treed404492dc96b6c371504dc95c1a960159e6f6220 /lisp/mastodon-tl.el
parent7b23d4d03aee72e54484034bc91bd51e909ead32 (diff)
pin/unpin now toggle fun, and moved copy/delete to mastodon-toot.
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el66
1 files changed, 0 insertions, 66 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 85f5641..5bc07e0 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -814,72 +814,6 @@ webapp"
(cdr (assoc 'descendants context))))))
(message "No Thread!")));)
-(defun mastodon-tl--copy-toot-url ()
- "Copy URL of toot at point."
- (interactive)
- (let* ((toot (mastodon-tl--property 'toot-json))
- (url (if (mastodon-tl--field 'reblog toot)
- (cdr (assoc 'url (cdr (assoc 'reblog toot))))
- (cdr (assoc 'url toot)))))
- (kill-new url)
- (message "Toot URL copied to the clipboard.")))
-
-;; TODO redraw buffer on success?
-(defun mastodon-tl--delete-toot ()
- "Delete user's toot at point synchronously."
- (interactive)
- (let* ((toot (mastodon-tl--property 'toot-json))
- (id (mastodon-tl--as-string (mastodon-tl--toot-id toot)))
- (url (mastodon-http--api (format "statuses/%s" id))))
- (if (or (cdr (assoc 'reblog toot))
- (not (equal (cdr (assoc 'acct
- (cdr (assoc 'account toot))))
- (mastodon-auth--user-acct))))
- (message "You can only delete your own toots.")
- (if (y-or-n-p (format "Delete this toot? "))
- (let ((response (mastodon-http--delete url)))
- (mastodon-http--triage response
- (lambda ()
- (message "Toot deleted!"))))))))
-
-;; TODO: rewrite pin/unpin as toggle functions
-(defun mastodon-tl--pin-toot ()
- "Pin user's toot at point synchronously."
- (interactive)
- (let* ((toot (mastodon-tl--property 'toot-json))
- (id (mastodon-tl--as-string (mastodon-tl--toot-id toot)))
- (url (mastodon-http--api (format "statuses/%s/pin" id)))
- (pinnable-p (and
- (not (cdr (assoc 'reblog toot)))
- (equal (cdr (assoc 'acct
- (cdr (assoc 'account toot))))
- (mastodon-auth--user-acct))))
- (pinned-p (equal (cdr (assoc 'pinned toot)) t)))
- (if (not pinnable-p)
- (message "You can only pin your own toots.")
- (if pinned-p
- (message "Looks like toot is already pinned.")
- (if (y-or-n-p (format "Pin this toot to your profile? "))
- (let ((response (mastodon-http--post url nil nil)))
- (mastodon-http--triage response
- (lambda ()
- (message "Toot pinned!")))))))))
-
-(defun mastodon-tl--unpin-toot ()
- "Unpin user's toot at point synchronously."
- (interactive)
- (let* ((toot (mastodon-tl--property 'toot-json))
- (id (mastodon-tl--as-string (mastodon-tl--toot-id toot)))
- (url (mastodon-http--api (format "statuses/%s/unpin" id)))
- (pinned-p (equal (cdr (assoc 'pinned toot)) t)))
- (if (not pinned-p)
- (message "No pinned toot to unpin here.")
- (if (y-or-n-p (format "Unpin this toot? "))
- (let ((response (mastodon-http--post url nil nil)))
- (mastodon-http--triage response
- (lambda ()
- (message "Toot unpinned!"))))))))
-
(defun mastodon-tl--follow-user (user-handle)
"Query for USER-HANDLE from current status and follow that user."
(interactive