mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-08 07:08:39 +01:00
- prevented crash when opening empty chat windows;
- fixed refreshing of chats.
This commit is contained in:
parent
44c2509201
commit
4b4f60269a
@ -48,15 +48,18 @@
|
|||||||
|
|
||||||
(defgeneric get-all-chats (object &key &allow-other-keys))
|
(defgeneric get-all-chats (object &key &allow-other-keys))
|
||||||
|
|
||||||
|
(defun sort-chat-id< (chats)
|
||||||
|
(sort chats #'string< :key #'chat-id))
|
||||||
|
|
||||||
(defmethod get-all-chats ((object tooter:client) &key (min-id nil) (accum ()))
|
(defmethod get-all-chats ((object tooter:client) &key (min-id nil) (accum ()))
|
||||||
"Get a list of all chats, ordered from the more recent updated."
|
"Get a list of all chats, ordered from the more recent updated."
|
||||||
(let ((chats (api-client:sort-id< (get-chats-list object :min-id min-id))))
|
(let ((chats (sort-chat-id< (get-chats-list object :min-id min-id))))
|
||||||
(if chats
|
(if chats
|
||||||
(let ((new-min-id (chat-id (last-elt chats))))
|
(let ((new-min-id (chat-id (last-elt chats))))
|
||||||
(get-all-chats object
|
(get-all-chats object
|
||||||
:min-id new-min-id
|
:min-id new-min-id
|
||||||
:accum (append chats accum)))
|
:accum (append chats accum)))
|
||||||
(api-client:sort-id< accum))))
|
(sort-chat-id< accum))))
|
||||||
|
|
||||||
(defgeneric post-chat-message (object chat-id content media))
|
(defgeneric post-chat-message (object chat-id content media))
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
(defun open-chats-list-window ()
|
(defun open-chats-list-window ()
|
||||||
(let* ((low-level-window (make-croatoan-window :enable-function-keys t)))
|
(let* ((low-level-window (make-croatoan-window :enable-function-keys t)))
|
||||||
(setf *chats-list-window*
|
(setf *chats-list-window*
|
||||||
(make-instance 'chats-list-window
|
(make-instance 'chats-list-window
|
||||||
:top-row-padding 0
|
:top-row-padding 0
|
||||||
:title (_ "Current chats")
|
:title (_ "Current chats")
|
||||||
|
@ -559,7 +559,8 @@
|
|||||||
|
|
||||||
(defmethod prepare-for-rendering ((object message-window) text-data &key (jump-to-first-row t))
|
(defmethod prepare-for-rendering ((object message-window) text-data &key (jump-to-first-row t))
|
||||||
(update-all-rows object (text->rendered-lines-rows object text-data))
|
(update-all-rows object (text->rendered-lines-rows object text-data))
|
||||||
(when jump-to-first-row
|
(when (and jump-to-first-row
|
||||||
|
(not (rows-empty-p object)))
|
||||||
(select-row object 0))
|
(select-row object 0))
|
||||||
object)
|
object)
|
||||||
|
|
||||||
|
@ -1526,7 +1526,8 @@
|
|||||||
(tui:with-notify-errors
|
(tui:with-notify-errors
|
||||||
(let ((chats (api-pleroma:get-chats)))
|
(let ((chats (api-pleroma:get-chats)))
|
||||||
(dolist (chat chats)
|
(dolist (chat chats)
|
||||||
(db:update-db chat))))))
|
(db:update-db chat)))
|
||||||
|
(line-oriented-window:resync-rows-db specials:*chats-list-window*))))
|
||||||
|
|
||||||
(defclass update-all-chat-messages-event (program-event) ())
|
(defclass update-all-chat-messages-event (program-event) ())
|
||||||
|
|
||||||
|
@ -161,5 +161,5 @@
|
|||||||
(:file "x509-tests")
|
(:file "x509-tests")
|
||||||
(:file "idn-tests")))))
|
(:file "idn-tests")))))
|
||||||
|
|
||||||
;;(push :debug-mode *features*)
|
(push :debug-mode *features*)
|
||||||
;;(push :debug-gemini-request *features*)
|
;;(push :debug-gemini-request *features*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user