From 2cc25a13872581eea9fc36b1ddc809f34cd3747a Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 16 Dec 2021 17:31:56 +0100 Subject: readme update --- README.org | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index 3a7a06e..ab2dbff 100644 --- a/README.org +++ b/README.org @@ -15,33 +15,34 @@ It adds the following features: | | show a lock icon for locked accounts | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | | =V= | view your favorited toots | -| =K= | view your bookmarked toots | | =i= | toggle pinning of toots | | =S-C-P= | jump to your profile | | =U= | update your profile bio note | | Notifications: | | | | follow requests now also appear in notifications | | =a=, =r= | accept/reject follow requests | +| | notifications for when a user posts (optional) | | Timelines: | | | =C= | copy url of toot at point | | =d= | delete your toot at point, and reload current timeline | | =D= | delete and redraft toot at point, preserving reply/CW/visibility | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | -| =k= | toggle bookmark of toot at point | -| | display polls and vote on polls (pretty basic for now) | +| =k=, =K= | toggle bookmark of toot at point, view bookmarked toots | +| | display polls and vote on them | | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | | | images scale properly | | | toot visibility (direct, followers only) icon appears in toot bylines | | | display a toot's favorites, boosts and replies count in thread view | +| | customize option to cache images | | Toots: | | | | mention booster in replies by default | -| | autocompletion of mentions, via company-mode (must be installed to work) | -| =C-c C-a= | media uploads | -| | media uploads previews in toot compose buffer | +| | replies preserve visibility status/CW of original toot | +| | autocompletion of user mentions, via =company-mode= (must be installed to work) | +| =C-c C-a= | media uploads, asynchronous | +| | media upload previews displayed in toot compose buffer | | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | | | download and use your instance's custom emoji | -| | replies preserve visibility status/CW of original toot | | | server's maximum toot length shown in toot compose buffer | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | @@ -73,27 +74,16 @@ This repo also incorporates fixes for two bugs that were never merged into the u - https://github.com/jdenen/mastodon.el/issues/227 (and https://github.com/jdenen/mastodon.el/issues/234) - https://github.com/jdenen/mastodon.el/issues/228 -** roadmap-ish - -I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: - -- [X] update profile note. -- [X] fix loading more notifications re-loads the same ones -- [X] view/accept/reject follow requests in notifications view. -- [X] fix sometimes usernames don't appear in timelines -- [X] voting on polls -- [X] delete and redraft toots -- [X] prevent loss of draft toots by the toot-send bug -- [X] fix scaling of images -- [X] display post visibility status in timelines -- [X] caching of images / avatars -- better display of polls -- [X] display number of boosts/faves in toot byline -- mention all thread participants in replies -- [X] improve (or even partially disable) async. +** 2FA It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. +** contributing + +Contributions are welcome. Registration is disabled by default on the gitea instance, but if you are interested, get in touch with me on mastodon: + +[[https://todon.nl/@mousebot][@mousebot@todon.nl]] + * Original README ** Installation -- cgit v1.2.3 From 5288ffc54c50d41cddcd432a258ada3f7f882a93 Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 17 Dec 2021 12:58:33 +0100 Subject: fix media attachments test before posting if --media-attachments is non-nil, make sure we have non-nil media-args, and that we have same num of -ids to attach as attachments uploaded. --- lisp/mastodon-toot.el | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 9a88bd5..8953ee6 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -463,24 +463,27 @@ If media items have been attached and uploaded with (symbol-name t))) ("spoiler_text" . ,spoiler))) (args-media (when mastodon-toot--media-attachments - (if (= (length mastodon-toot--media-attachments) - (length mastodon-toot--media-attachment-ids)) - ;; (mastodon-toot--upload-attached-media) - ;; moved upload to mastodon-toot--attach-media (mapcar (lambda (id) (cons "media_ids[]" id)) - mastodon-toot--media-attachment-ids) - (message "Looks like something went wrong with your uploads. Maybe you want to try again.")))) + mastodon-toot--media-attachment-ids))) (args (append args-media args-no-media))) - (if (> (length toot) (string-to-number mastodon-toot--max-toot-chars)) - (message "Looks like your toot is longer than that maximum allowed length.") - (if empty-toot-p - (message "Empty toot. Cowardly refusing to post this.") - (let ((response (mastodon-http--post endpoint args nil))) - (mastodon-http--triage response - (lambda () - (mastodon-toot--kill) - (message "Toot toot!")))))))) + (cond ((and mastodon-toot--media-attachments + ;; make sure we have media args + ;; and the same num of ids as attachments + (or (not args-media) + (not (= (length mastodon-toot--media-attachments) + (length mastodon-toot--media-attachment-ids))))) + (message "Something is wrong with your uploads. Wait for them to complete or try again.")) + ((> (length toot) (string-to-number mastodon-toot--max-toot-chars)) + (message "Looks like your toot is longer than that maximum allowed length.")) + (empty-toot-p + (message "Empty toot. Cowardly refusing to post this.")) + (t + (let ((response (mastodon-http--post endpoint args nil))) + (mastodon-http--triage response + (lambda () + (mastodon-toot--kill) + (message "Toot toot!")))))))) (defun mastodon-toot--process-local (acct) "Add domain to local ACCT and replace the curent user name with \"\". -- cgit v1.2.3 From 469974fa74e1661ea0a60cb5249ee0d3c6f640fd Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 17 Dec 2021 13:10:42 +0100 Subject: ensure media-attachment is not a dir --- lisp/mastodon-toot.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 71bd3ad..2ff7f83 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -632,15 +632,17 @@ File is actually attached to the toot upon posting." (when (>= (length mastodon-toot--media-attachments) 4) ;; Only a max. of 4 attachments are allowed, so pop the oldest one. (pop mastodon-toot--media-attachments)) - (setq mastodon-toot--media-attachments - (nconc mastodon-toot--media-attachments - `(((:contents . ,(mastodon-http--read-file-as-string file)) - (:content-type . ,content-type) - (:description . ,description) - (:filename . ,file))))) - (mastodon-toot--refresh-attachments-display) - ;; upload only most recent attachment: - (mastodon-toot--upload-attached-media (car (last mastodon-toot--media-attachments)))) + (if (file-directory-p file) + (message "Looks like you chose a directory not a file.") + (setq mastodon-toot--media-attachments + (nconc mastodon-toot--media-attachments + `(((:contents . ,(mastodon-http--read-file-as-string file)) + (:content-type . ,content-type) + (:description . ,description) + (:filename . ,file))))) + (mastodon-toot--refresh-attachments-display) + ;; upload only most recent attachment: + (mastodon-toot--upload-attached-media (car (last mastodon-toot--media-attachments))))) (defun mastodon-toot--upload-attached-media (attachment) "Upload a single attachment using `mastodon-http--post-media-attachment'. -- cgit v1.2.3