From 3e62f6fd3b4535a004cee050a13992802abbce99 Mon Sep 17 00:00:00 2001 From: cage Date: Fri, 24 May 2024 14:37:42 +0200 Subject: [PATCH] - [fediverse] scheduled checking for instance's announcement on boot. --- src/scheduled-events.lisp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/scheduled-events.lisp b/src/scheduled-events.lisp index cd0ff76..38f9c97 100644 --- a/src/scheduled-events.lisp +++ b/src/scheduled-events.lisp @@ -67,9 +67,7 @@ (gen-scheduler-function (look-for-announcements +announcements-check-frequency+) - (when *thread-window* - (ui:notify (_ "Looking for announcements…")) - (program-events:push-event (make-instance 'program-events:check-announcements-event)))) + (%look-for-announcements)) (gen-at-boot-function purge-history (db:purge-history)) @@ -81,6 +79,14 @@ (gen-at-boot-function sync-gempub-library (gempub:sync-library :notify t)) +(defun %look-for-announcements () + (when *thread-window* + (ui:notify (_ "Looking for announcements…")) + (program-events:push-event (make-instance 'program-events:check-announcements-event)))) + +(gen-at-boot-function look-for-announcement-on-boot + (%look-for-announcements)) + (defun run-scheduled-events (ticks) (when (api-pleroma:instance-pleroma-p) (refresh-all-chats-messages ticks) @@ -91,4 +97,5 @@ (purge-gemlog-entries ticks) (purge-history) (refresh-gemlog-posts) - (sync-gempub-library)) + (sync-gempub-library) + (look-for-announcement-on-boot))