[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon c3db1170e8 33/52: edit toot at point: do-if-item-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon c3db1170e8 33/52: edit toot at point: do-if-item-strict |
Date: |
Mon, 30 Oct 2023 16:01:26 -0400 (EDT) |
branch: elpa/mastodon
commit c3db1170e80c90563ccfee76b6d12502f4d53f2a
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
edit toot at point: do-if-item-strict
---
lisp/mastodon-toot.el | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 3f20a145f9..682f6ca642 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -876,25 +876,26 @@ instance to edit a toot."
(defun mastodon-toot--edit-toot-at-point ()
"Edit the user's toot at point."
(interactive)
- (let ((toot (or (mastodon-tl--property 'base-toot) ; fave/boost notifs
- (mastodon-tl--property 'item-json))))
- (if (not (mastodon-toot--own-toot-p toot))
- (message "You can only edit your own toots.")
- (let* ((id (mastodon-tl--as-string (mastodon-tl--item-id toot)))
- (source (mastodon-toot--get-toot-source id))
- (content (alist-get 'text source))
- (source-cw (alist-get 'spoiler_text source))
- (toot-visibility (alist-get 'visibility toot))
- (toot-language (alist-get 'language toot))
- (reply-id (alist-get 'in_reply_to_id toot)))
- (when (y-or-n-p "Edit this toot? ")
- (mastodon-toot--compose-buffer nil reply-id nil content :edit)
- (goto-char (point-max))
- ;; adopt reply-to-id, visibility, CW, and language:
- (mastodon-toot--set-toot-properties reply-id toot-visibility
- source-cw toot-language)
- (mastodon-toot--update-status-fields)
- (setq mastodon-toot--edit-item-id id))))))
+ (mastodon-tl--do-if-item-strict
+ (let ((toot (or (mastodon-tl--property 'base-toot) ; fave/boost notifs
+ (mastodon-tl--property 'item-json))))
+ (if (not (mastodon-toot--own-toot-p toot))
+ (message "You can only edit your own toots.")
+ (let* ((id (mastodon-tl--as-string (mastodon-tl--item-id toot)))
+ (source (mastodon-toot--get-toot-source id))
+ (content (alist-get 'text source))
+ (source-cw (alist-get 'spoiler_text source))
+ (toot-visibility (alist-get 'visibility toot))
+ (toot-language (alist-get 'language toot))
+ (reply-id (alist-get 'in_reply_to_id toot)))
+ (when (y-or-n-p "Edit this toot? ")
+ (mastodon-toot--compose-buffer nil reply-id nil content :edit)
+ (goto-char (point-max))
+ ;; adopt reply-to-id, visibility, CW, and language:
+ (mastodon-toot--set-toot-properties reply-id toot-visibility
+ source-cw toot-language)
+ (mastodon-toot--update-status-fields)
+ (setq mastodon-toot--edit-item-id id)))))))
(defun mastodon-toot--get-toot-source (id)
"Fetch the source JSON of toot with ID."
- [nongnu] elpa/mastodon 47865bd215 30/52: tl--prev-toot-id: don't assume our funs return anything., (continued)
- [nongnu] elpa/mastodon 47865bd215 30/52: tl--prev-toot-id: don't assume our funs return anything., ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon f1bc8d83d4 35/52: display replies policy & exclusive status for lists, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 3dc21b91b1 38/52: tl--update: add lists, and note abt what we shd actually do, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 40e8123b84 47/52: Merge branch 'triage-response-data' into develop, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon e380f74a44 49/52: profile--item-json is no cmd, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 5f237982e5 40/52: a quick hack to toggle display of a user's boosts in timeline. FIX# 503, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 87a6bc9d7d 45/52: readme contributing, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 31643d6f63 16/52: Merge branch 'minor-view' into develop, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon a53d9824fe 19/52: change some error calls to user-error calls, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon 4a9c2015ee 26/52: fix elpaignore, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon c3db1170e8 33/52: edit toot at point: do-if-item-strict,
ELPA Syncer <=
- [nongnu] elpa/mastodon fd697f98c3 39/52: no more/update for filters view, ELPA Syncer, 2023/10/30
- [nongnu] elpa/mastodon d19cc98b57 23/52: remove redundant next-/prev-item from views maps, ELPA Syncer, 2023/10/30