aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/post.ml12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/post.ml b/lib/post.ml
index 3b63a11..744e296 100644
--- a/lib/post.ml
+++ b/lib/post.ml
@@ -15,7 +15,7 @@ type mastodon_tag = {
}
[@@deriving yojson] [@@yojson.allow_extra_fields]
-type mastodon_object = { tag : mastodon_tag list }
+type mastodon_object = { tag : mastodon_tag list; url : string }
[@@deriving yojson] [@@yojson.allow_extra_fields]
type mastodon_post = {
@@ -28,7 +28,7 @@ type mastodon_post = {
let mastodon_actor post = post.actor
let post_of_mastodon_post actor_name = function
- | { actor; published; obj = { tag } } ->
+ | { published; obj = { tag; url }; _ } ->
let tags =
List.filter_map
(fun { name; kind; _ } ->
@@ -37,13 +37,7 @@ let post_of_mastodon_post actor_name = function
if kind = "Hashtag" then Some name else None)
tag
in
- {
- link = actor;
- summary = published;
- tags;
- published;
- author = actor_name;
- }
+ { link = url; summary = published; tags; published; author = actor_name }
let get_tld (link : string) =
Uri.of_string link |> Uri.host_with_default ~default:""