1
0
Fork 0

- fixed line wrapping of announcements window.

This commit is contained in:
cage 2024-03-31 13:56:20 +02:00
parent ceaeeb8ec6
commit c1d4024185
1 changed files with 14 additions and 7 deletions

View File

@ -1895,14 +1895,21 @@
"Shows a window with all announcements"
(when-let* ((all-announcements (api-client:get-announcements))
(all-texts (mapcar (lambda (a)
(html-utils:html->text a
:quote-prefix (swconf:message-window-quote-prefix)
:list-item-prefix (swconf:message-window-bullet-prefix)))
(text-utils:justify-monospaced-text (html-utils:html->text a
:quote-prefix
(swconf:message-window-quote-prefix)
:list-item-prefix
(swconf:message-window-bullet-prefix))
(truncate (* 3/4
(windows:win-width specials:*main-window*)))))
(mapcar #'tooter:content all-announcements)))
(lines (reduce #'append
(mapcar #'text-utils:split-lines all-texts)))
(window-content (text-utils:join-with-strings* (swconf:config-announcements-separator)
lines)))
(lines (mapcar (lambda (a)
(append a
(list ""
(swconf:config-announcements-separator)
"")))
all-texts))
(window-content (flatten lines)))
(api-client:dismiss-all-announcements all-announcements)
(line-oriented-window:make-blocking-list-dialog-window specials:*main-window*
window-content