mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-11 22:35:20 +01:00
Compare commits
4 Commits
e070f89b05
...
5239263f96
Author | SHA1 | Date | |
---|---|---|---|
|
5239263f96 | ||
|
58094bfd59 | ||
|
6cf783bb39 | ||
|
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*)
|
||||
|
488
po/tinmop.pot
488
po/tinmop.pot
File diff suppressed because it is too large
Load Diff
52
src/db.lisp
52
src/db.lisp
@ -2479,6 +2479,28 @@ Metadata are:
|
||||
(order-by= query '(:desc :message-index))
|
||||
(fetch-single query)))
|
||||
|
||||
|
||||
(defun search-next-message-by-status (timeline
|
||||
folder
|
||||
start-status-message-index
|
||||
filter-status-column
|
||||
filter-status-column-value
|
||||
&key (account-id nil))
|
||||
"Search the next unread message belonging
|
||||
to `timeline' , `folder' and possibly `account-id', older than
|
||||
`start-status-message-index'"
|
||||
(let* ((filter-criteria `(:and := ,filter-status-column
|
||||
,filter-status-column-value))
|
||||
(query (make-filtered-message-select nil
|
||||
timeline
|
||||
folder
|
||||
account-id
|
||||
`(:and :> :status.message-index
|
||||
,start-status-message-index)
|
||||
filter-criteria)))
|
||||
(order-by= query :message-index)
|
||||
(fetch-single query)))
|
||||
|
||||
(defun search-next-unread-message (timeline
|
||||
folder
|
||||
start-status-message-index
|
||||
@ -2486,16 +2508,26 @@ Metadata are:
|
||||
"Search the next unread 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.redp
|
||||
,+db-false+))))
|
||||
(order-by= query :message-index)
|
||||
(fetch-single query)))
|
||||
(search-next-message-by-status timeline
|
||||
folder
|
||||
start-status-message-index
|
||||
:status.redp
|
||||
+db-false+
|
||||
:account-id account-id))
|
||||
|
||||
(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'"
|
||||
(search-next-message-by-status timeline
|
||||
folder
|
||||
start-status-message-index
|
||||
:status.deletedp
|
||||
+db-false+
|
||||
:account-id account-id))
|
||||
|
||||
(defmacro with-add-account-id-to-query ((query query-body) account-id &body body)
|
||||
`(let ((,query ,query-body))
|
||||
|
@ -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
|
||||
|
@ -1046,21 +1046,32 @@ db:renumber-timeline-message-index."
|
||||
:previous
|
||||
(_ "No previous message that contains ~s exists")))
|
||||
|
||||
(defmethod search-next-unread ((object thread-window))
|
||||
(defun search-next-by-status (thread-window searching-function error-message)
|
||||
(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-unread-message timeline-type
|
||||
timeline-folder
|
||||
starting-index)))
|
||||
(timeline-type timeline-type)) thread-window
|
||||
(a:when-let* ((selected-fields (selected-row-fields thread-window))
|
||||
(starting-index (db-utils:db-getf selected-fields :message-index)))
|
||||
(let ((matching-status (funcall searching-function
|
||||
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 unread messages exist")))))))
|
||||
(rebuild-lines thread-window new-message-index)
|
||||
(open-message thread-window))
|
||||
(ui:info-message error-message))))))
|
||||
|
||||
(defmethod search-next-unread ((object thread-window))
|
||||
(search-next-by-status object
|
||||
#'db:search-next-unread-message
|
||||
(_ "No others unread message exists")))
|
||||
|
||||
(defmethod search-next-undeleted ((object thread-window))
|
||||
(search-next-by-status object
|
||||
#'db:search-next-undeleted-message
|
||||
(_ "No others message marked for deletion exists")))
|
||||
|
||||
(defmethod add-mention ((object thread-window) mention)
|
||||
(with-accessors ((mentions mentions)) object
|
||||
|
@ -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
Block a user