mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-22 23:47:56 +01:00
- [TUI] added command to download a message's attachment ignoring the cached value (if such entry in the cache exists).
This commit is contained in:
parent
7f6da862cc
commit
8c8b5555f7
@ -640,8 +640,13 @@
|
|||||||
"Copy the selected link to clipboard"
|
"Copy the selected link to clipboard"
|
||||||
(copy-link-to-clipboard specials:*open-attach-window*))
|
(copy-link-to-clipboard specials:*open-attach-window*))
|
||||||
|
|
||||||
|
(defun open-attachment-ignoring-cache ()
|
||||||
|
(open-message-attach-perform-opening :ignore-cache t))
|
||||||
|
|
||||||
(define-key "C-J" #'open-message-attach-perform-opening *open-attach-keymap*)
|
(define-key "C-J" #'open-message-attach-perform-opening *open-attach-keymap*)
|
||||||
|
|
||||||
|
(define-key "O" #'open-attachment-ignoring-cache *open-attach-keymap*)
|
||||||
|
|
||||||
(define-key "C-c" #'copy-from-attach-window-to-clipboard *open-attach-keymap*)
|
(define-key "C-c" #'copy-from-attach-window-to-clipboard *open-attach-keymap*)
|
||||||
|
|
||||||
(define-key "a" #'open-all-message-attachments *open-attach-keymap*)
|
(define-key "a" #'open-all-message-attachments *open-attach-keymap*)
|
||||||
@ -650,7 +655,7 @@
|
|||||||
|
|
||||||
(define-key "j" #'open-message-attach-go-down *open-attach-keymap*)
|
(define-key "j" #'open-message-attach-go-down *open-attach-keymap*)
|
||||||
|
|
||||||
(define-key "k" #'open-message-attach-go-up *open-attach-keymap*)
|
(define-key "k" #'open-message-attach-go-up *open-attach-keymap*)
|
||||||
|
|
||||||
(define-key "q" #'close-open-attach-window *open-attach-keymap*)
|
(define-key "q" #'close-open-attach-window *open-attach-keymap*)
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
(when matchedp
|
(when matchedp
|
||||||
(first-elt res))))
|
(first-elt res))))
|
||||||
|
|
||||||
(defun open-attachment (url)
|
(defun open-attachment (url &key (ignore-cache nil))
|
||||||
(labels ((add-extension (cached-value)
|
(labels ((add-extension (cached-value)
|
||||||
(strcat (to-s cached-value) (get-extension url)))
|
(strcat (to-s cached-value) (get-extension url)))
|
||||||
(fill-cache (url)
|
(fill-cache (url)
|
||||||
@ -164,7 +164,8 @@
|
|||||||
(open-attachment url)))
|
(open-attachment url)))
|
||||||
(let ((cached-file (os-utils:cached-file-path (add-extension cached))))
|
(let ((cached-file (os-utils:cached-file-path (add-extension cached))))
|
||||||
(if (or (not (fs:file-exists-p cached-file))
|
(if (or (not (fs:file-exists-p cached-file))
|
||||||
(<= (fs:file-size cached-file) 0))
|
(<= (fs:file-size cached-file) 0)
|
||||||
|
ignore-cache)
|
||||||
(progn
|
(progn
|
||||||
(db:cache-invalidate url)
|
(db:cache-invalidate url)
|
||||||
(open-attachment url))
|
(open-attachment url))
|
||||||
|
@ -1494,10 +1494,10 @@ It an existing file path is provided the command will refuse to run."
|
|||||||
(defun open-message-attach-go-up ()
|
(defun open-message-attach-go-up ()
|
||||||
(open-message-attach-move -1))
|
(open-message-attach-move -1))
|
||||||
|
|
||||||
(defun open-message-attach-perform-opening ()
|
(defun open-message-attach-perform-opening (&key (ignore-cache nil))
|
||||||
(when-let* ((selected-line (line-oriented-window:selected-row *open-attach-window*))
|
(when-let* ((selected-line (line-oriented-window:selected-row *open-attach-window*))
|
||||||
(url (line-oriented-window:normal-text selected-line)))
|
(url (line-oriented-window:normal-text selected-line)))
|
||||||
(open-attach-window:open-attachment url)))
|
(open-attach-window:open-attachment url :ignore-cache ignore-cache)))
|
||||||
|
|
||||||
(defun close-open-attach-window ()
|
(defun close-open-attach-window ()
|
||||||
(close-window-and-return-to-threads *open-attach-window*))
|
(close-window-and-return-to-threads *open-attach-window*))
|
||||||
|
Loading…
Reference in New Issue
Block a user