diff options
author | Marc Coquand <marcc@fastmail.fr> | 2023-12-02 11:28:42 -0600 |
---|---|---|
committer | Marc Coquand <marcc@fastmail.fr> | 2023-12-02 11:28:42 -0600 |
commit | 581f3332876a90a0df7a202070e3f7ae9b371fba (patch) | |
tree | 4a9958dbecd009d28b418b2b7c33b738daeb30d7 /lib/post.ml | |
parent | 189179574d847e8e9662cf78804ce9371fac988d (diff) | |
download | wormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.tar.gz wormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.tar.bz2 wormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.zip |
Fix build dep, use post url
Diffstat (limited to '')
-rw-r--r-- | lib/post.ml | 12 |
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:"" |