1
0
Fork 0

- fixed thread-window:resync-rows-db, was not redrawing the window if no message was presents.

This commit is contained in:
cage 2021-09-11 21:54:52 +02:00
parent 49f9232288
commit c12f444111
1 changed files with 36 additions and 15 deletions

View File

@ -756,29 +756,43 @@ db:renumber-timeline-message-index."
(select-row object new-index)))
(draw object)))))
(defun message-index-valid-p (timeline-type timeline-folder message-index)
(db:message-from-timeline-folder-message-index timeline-type
timeline-folder
message-index))
(defun update-thread-window (window message-index)
(multiple-value-bind (tree pos)
(fit-timeline-to-window window message-index)
(build-lines window tree pos)))
(defmethod goto-message ((object thread-window) (message-index number) &key (redraw t))
(with-accessors ((timeline-folder timeline-folder)
(timeline-type timeline-type)) object
(let ((message (db:message-from-timeline-folder-message-index timeline-type
(let ((message-index-valid-p (message-index-valid-p timeline-type
timeline-folder
message-index)))
(if message
(multiple-value-bind (tree pos)
(fit-timeline-to-window object message-index)
(build-lines object tree pos)
(if message-index-valid-p
(progn
(update-thread-window object message-index)
(when redraw
(draw object)))
(ui:info-message (format nil
(_ "No message with index ~a exists.")
message-index))))))
(defun message-tuple-id->message-index (timeline-type timeline-folder status-id)
(when-let* ((message (db::message-from-timeline-folder-id timeline-type
timeline-folder
status-id)))
(db:row-message-index message)))
(defmethod goto-message ((object thread-window) (message-index string) &key (redraw t))
(with-accessors ((timeline-folder timeline-folder)
(timeline-type timeline-type)) object
(when-let* ((message (db::message-from-timeline-folder-id timeline-type
(when-let* ((index (message-tuple-id->message-index timeline-type
timeline-folder
message-index))
(index (db:row-message-index message)))
message-index)))
(goto-message object index :redraw redraw))))
(defmethod goto-first-message ((object thread-window))
@ -800,17 +814,24 @@ db:renumber-timeline-message-index."
(suggested-message-index nil)
(suggested-status-id nil))
(with-accessors ((row-selected-index row-selected-index)
(rows rows)) object
(rows rows)
(timeline-folder timeline-folder)
(timeline-type timeline-type)) object
(when-window-shown (object)
(cond
(suggested-status-id
(goto-message object suggested-status-id :redraw redraw))
(let ((message-index (message-tuple-id->message-index timeline-type
timeline-folder
suggested-status-id)))
(update-thread-window object message-index)))
(suggested-message-index
(goto-message object suggested-message-index :redraw redraw))
(update-thread-window object suggested-message-index))
(t
(let* ((selected-row (selected-row object))
(message-index (db:row-message-index (fields selected-row))))
(goto-message object message-index :redraw redraw))))))
(update-thread-window object message-index))))
(when redraw
(draw object))))
object)
(defun reblogged-data (reblogger-status)