1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-14 22:54:02 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
cage
0d9d83280e - refactored gemlog updating event. 2021-08-14 11:22:26 +02:00
cage
15dfebff46 - ignored error when refreshing gemlogs. 2021-08-14 11:17:10 +02:00

View File

@ -1291,23 +1291,27 @@
keybindings:*gemini-message-keymap*)
(windows:draw specials:*message-window*))))
(defclass gemlog-refresh-thread (program-event) ())
(defmethod process-event ((object gemlog-refresh-thread))
(let* ((subscription (payload object))
(notification-message (format nil (_ "updating gemlog ~a") subscription)))
(ui:notify-procedure (lambda ()
(db-utils:with-ready-database ()
(ignore-errors
(gemini-subscription:refresh subscription))))
notification-message
:ending-message nil)))
(defclass gemlog-refresh-all-event (program-event) ())
(defmethod process-event ((object gemlog-refresh-all-event))
(let ((all-subscribed-gemlogs (mapcar #'db:row-url (db:gemini-all-subscriptions))))
(mapcar (lambda (subscription)
(let* ((notification-message (format nil (_ "updating gemlog ~a") subscription))
(payload (lambda ()
(ui:notify-procedure (lambda ()
(db-utils:with-ready-database ()
(gemini-subscription:refresh subscription)))
notification-message
:ending-message nil)))
(event (make-instance 'function-event
:payload payload
:priority +minimum-event-priority+)))
(push-event event)))
all-subscribed-gemlogs)))
(loop for subscription in all-subscribed-gemlogs do
(let ((event (make-instance 'gemlog-refresh-thread
:payload subscription
:priority +minimum-event-priority+)))
(push-event event)))))
(defclass gemini-toc-jump-to-section (program-event)
((toc-win