branch: elpa/mastodon
commit f17f34b3dd42651b154937e6108b977707812ae8
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    revoke a quote from quote notification. FIX #755.
---
 lisp/mastodon-notifications.el | 19 +++++++++++++++++++
 lisp/mastodon-tl.el            |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 113f3a5908..61387522bf 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -828,6 +828,25 @@ Status notifications are created when you call
          (resp (mastodon-http--get-json url)))
     (alist-get 'count resp)))
 
+;;; REVOKE QUOTED STATUS
+;; POST /api/v1/statuses/:id/quotes/:quoting_status_id/revoke.
+(defun mastodon-notifications-revoke-post-quote ()
+  "Revoke the quote of a post from a quote notification."
+  (interactive)
+  ;; SCOPE required: check quote notif type, which will have user post in
+  ;; the "status" attribute:
+  (let* ((notif (mastodon-tl--property 'item-json :no-move))
+         (id (map-nested-elt notif '(quote quoted_status id)))
+         (quote-id (alist-get 'id notif))
+         (url (mastodon-http--api (format "statuses/%s/quotes/%s/revoke"
+                                          id quote-id))))
+    (when (y-or-n-p "Revoke quote of post at point?")
+      (let ((resp (mastodon-http--post url)))
+        (mastodon-http--triage
+         resp
+         (lambda (resp)
+           (message "Quote of post revoked!")))))))
+
 ;;; NOTIFICATION REQUESTS / FILTERING / POLICY
 
 (defvar mastodon-notifications--requests-map
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 2c62e46fb7..40152f4a5e 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1921,7 +1921,10 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
         (quotemark (propertize "“" 'face
                                '(t :inherit success :weight bold
                                    :height 1.8))))
+    ;; FIXME: we need a list of these in a var, maybe only allow rather
+    ;; than blocking:
     (unless (or (string= "deleted" state)
+                (string= "revoked" state)
                 (string= "pending" state))
       (propertize
        (concat quotemark "\n"

Reply via email to