This commit is contained in:
Swrup 2022-02-27 19:58:32 +01:00
parent bff747b4ca
commit 048f77098b
5 changed files with 24 additions and 21 deletions

View file

@ -301,7 +301,10 @@ let feed thread_id =
let^ ids = Db.collect_list Q.get_thread_posts thread_id in
let* posts = get_posts ids in
let posts = List.sort (fun a b -> compare b.date a.date) posts in
let last_update = (List.nth posts 0).date in
let* last_update =
match posts with op :: _ -> Ok op.date | _ -> Error "empty thread"
in
let entries fmt () =
(Format.pp_print_list ~pp_sep:Format.pp_print_space pp_feed_entry) fmt posts
in