mirror of https://codeberg.org/cage/tinmop/
- [fediverse] added command: 'thread-search-next-undeleted-message'.
This commit is contained in:
parent
e070f89b05
commit
15b9e82ba1
|
@ -395,6 +395,8 @@
|
|||
|
||||
(define-key "n" #'thread-search-next-unread-message *thread-keymap*)
|
||||
|
||||
(define-key "C-u" #'thread-search-next-undeleted-message *thread-keymap*)
|
||||
|
||||
(define-key "r" #'reply-message *thread-keymap*)
|
||||
|
||||
(define-key "right" #'open-next *thread-keymap*)
|
||||
|
|
18
src/db.lisp
18
src/db.lisp
|
@ -2497,6 +2497,24 @@ to `timeline' , `folder' and possibly `account-id', older than
|
|||
(order-by= query :message-index)
|
||||
(fetch-single query)))
|
||||
|
||||
(defun search-next-undeleted-message (timeline
|
||||
folder
|
||||
start-status-message-index
|
||||
&key (account-id nil))
|
||||
"Search the next undeleted message belonging
|
||||
to `timeline' , `folder' and possibly `account-id', older than
|
||||
`start-status-message-index'"
|
||||
(let* ((query (make-filtered-message-select nil
|
||||
timeline
|
||||
folder
|
||||
account-id
|
||||
`(:and :> :status.message-index
|
||||
,start-status-message-index)
|
||||
`(:and := :status.deletedp
|
||||
,+db-false+))))
|
||||
(order-by= query :message-index)
|
||||
(fetch-single query)))
|
||||
|
||||
(defmacro with-add-account-id-to-query ((query query-body) account-id &body body)
|
||||
`(let ((,query ,query-body))
|
||||
(when ,account-id
|
||||
|
|
|
@ -1087,6 +1087,7 @@
|
|||
:search-next-message-meta
|
||||
:search-previous-message-meta
|
||||
:search-next-unread-message
|
||||
:search-next-undeleted-message
|
||||
:last-message-index-status
|
||||
:last-status-id-timeline-folder
|
||||
:first-status-id-timeline-folder
|
||||
|
@ -2495,6 +2496,7 @@
|
|||
:search-next-message-meta
|
||||
:search-previous-message-meta
|
||||
:search-next-unread
|
||||
:search-next-undeleted
|
||||
:add-mention
|
||||
:remove-mention
|
||||
:goto-message
|
||||
|
@ -3048,6 +3050,7 @@
|
|||
:thread-search-previous-message-meta
|
||||
:repeat-search
|
||||
:thread-search-next-unread-message
|
||||
:thread-search-next-undeleted-message
|
||||
:thread-open-selected-message
|
||||
:thread-mark-delete-selected-message
|
||||
:thread-mark-prevent-delete-selected-message
|
||||
|
|
|
@ -1062,6 +1062,22 @@ db:renumber-timeline-message-index."
|
|||
(open-message object))
|
||||
(ui:info-message (_ "No others unread messages exist")))))))
|
||||
|
||||
(defmethod search-next-undeleted ((object thread-window))
|
||||
(with-accessors ((row-selected-index row-selected-index)
|
||||
(rows rows)
|
||||
(timeline-folder timeline-folder)
|
||||
(timeline-type timeline-type)) object
|
||||
(a:when-let* ((selected-fields (selected-row-fields object))
|
||||
(starting-index (db-utils:db-getf selected-fields :message-index)))
|
||||
(let ((matching-status (db:search-next-undeleted-message timeline-type
|
||||
timeline-folder
|
||||
starting-index)))
|
||||
(if matching-status
|
||||
(let ((new-message-index (db:row-message-index matching-status)))
|
||||
(rebuild-lines object new-message-index)
|
||||
(open-message object))
|
||||
(ui:info-message (_ "No others undeleted messages exist")))))))
|
||||
|
||||
(defmethod add-mention ((object thread-window) mention)
|
||||
(with-accessors ((mentions mentions)) object
|
||||
(let ((reversed (reverse mentions)))
|
||||
|
|
|
@ -343,6 +343,10 @@ Metadata includes:
|
|||
"Jump to next unread message"
|
||||
(thread-window:search-next-unread *thread-window*))
|
||||
|
||||
(defun thread-search-next-undeleted-message ()
|
||||
"Jump to next undeleted message"
|
||||
(thread-window:search-next-undeleted *thread-window*))
|
||||
|
||||
(defun repeat-search ()
|
||||
"Repeat the last search performed"
|
||||
(push-event (make-instance 'search-next-event
|
||||
|
|
Loading…
Reference in New Issue