1
0
Fork 0

- fixed command: 'thread-go-to-parent-post'.

This commit is contained in:
cage 2024-04-04 17:13:48 +02:00
parent 77249e97e3
commit a118ce13de
1 changed files with 16 additions and 8 deletions

View File

@ -3637,12 +3637,20 @@ gemini client certificates!)."
:complete-fn #'complete:fediverse-account)))
(defun thread-go-to-parent-post ()
"Select and move to th parent of the current selected post"
(when-let* ((selected-row (line-oriented-window:selected-row-fields *thread-window*))
(status-id (actual-author-message-id selected-row))
(parent-row (db:get-parent-status-row status-id))
(index (db:row-message-index parent-row))
(event (make-instance 'thread-goto-message
:payload index)))
(info-message (format nil "~a" index))
"Select and move to the parent of the current selected post"
(when-let* ((timeline (thread-window:timeline-type *thread-window*))
(folder (thread-window:timeline-folder *thread-window*))
(selected-row (line-oriented-window:selected-row-fields *thread-window*))
(status-id (actual-author-message-id selected-row))
;; NB: db:get-parent-status-row does not take into account the folder or timeline...
(generic-parent-row (db:get-parent-status-row status-id))
(generic-parent-id (db:row-message-status-id generic-parent-row))
;; ...so we need to call
;; db::find-status-id-folder-timeline to get the actual
;; row for the folder and timeline the user is reading...
(status-parent-row (db::find-status-id-folder-timeline generic-parent-id folder timeline))
;; ...and get the correct message index
(index (db:row-message-index status-parent-row))
(event (make-instance 'thread-goto-message
:payload index)))
(push-event event)))