branch: elpa/mastodon commit 4e02a7cd8c640218666d22d8ec072ca3f33554a0 Author: marty hiatt <martianhia...@disroot.org> Commit: marty hiatt <martianhia...@disroot.org>
fix media-attachment-ids order. FIX #655. attachments were being posted in the reverse order that the user uploaded them. we can't just reverse the ids list upon posting though, as that would happen again when we posted an edit of a post or similar. so we resolved to try to only ever generate the list in the correct order upon uploading. --- lisp/mastodon-http.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 47b96fed12..2c4c49d1bb 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -379,7 +379,12 @@ item uploaded, and `mastodon-toot--update-status-fields' is run." (when data (let* ((id (alist-get 'id data))) ;; update ids: - (push id mastodon-toot--media-attachment-ids) + (if (not mastodon-toot--media-attachment-ids) + ;; add first id: + (push id mastodon-toot--media-attachment-ids) + ;; add new id to end of list to preserve order: + (push id (cdr + (last mastodon-toot--media-attachment-ids)))) ;; pleroma, PUT the description: ;; this is how the mangane akkoma web client does it ;; and it seems easier than the other options!