From fdd73cdd9d53d109d553af7f9bd66d87af5ffad2 Mon Sep 17 00:00:00 2001 From: cage Date: Thu, 9 Sep 2021 18:27:32 +0200 Subject: [PATCH] - added a command to open all the attachments of a post. --- etc/init.lisp | 2 ++ src/package.lisp | 1 + src/ui-goodies.lisp | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/etc/init.lisp b/etc/init.lisp index 4cc3faf..c40bf7a 100644 --- a/etc/init.lisp +++ b/etc/init.lisp @@ -483,6 +483,8 @@ (define-key "C-J" #'open-message-attach-perform-opening *open-attach-keymap*) +(define-key "a" #'open-all-message-attachments *open-attach-keymap*) + (define-key "up" #'open-message-attach-go-up *open-attach-keymap*) (define-key "down" #'open-message-attach-go-down *open-attach-keymap*) diff --git a/src/package.lisp b/src/package.lisp index 4a89f83..bed0180 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -2580,6 +2580,7 @@ :compose-message :reply-message :open-message-attach + :open-all-message-attachments :open-message-attach-go-up :open-message-attach-go-down :open-message-attach-perform-opening diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index b3de8ab..eaa11a1 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -1138,6 +1138,15 @@ If some posts was deleted before, download them again." (open-attach-window:init (db:row-message-status-id selected-message)) (focus-to-open-attach-window))) +(defun open-all-message-attachments () + (when-let* ((win *thread-window*) + (selected-message (line-oriented-window:selected-row-fields win)) + (status-id (db:row-message-status-id selected-message)) + (attachment-urls (db:all-attachments-urls-to-status status-id + :add-reblogged-urls t))) + (loop for attachment-url in attachment-urls do + (open-attach-window:open-attachment attachment-url)))) + (defun open-message-attach-move (amount) (ignore-errors (line-oriented-window:unselect-all *open-attach-window*)