diff --git a/lib/service/metadata/comment.ex b/lib/service/metadata/comment.ex index 99c893642..d36aebc07 100644 --- a/lib/service/metadata/comment.ex +++ b/lib/service/metadata/comment.ex @@ -2,7 +2,8 @@ defimpl Mobilizon.Service.Metadata, for: Mobilizon.Discussions.Comment do alias Phoenix.HTML.Tag alias Mobilizon.Discussions.Comment - def build_tags(%Comment{} = comment, _locale \\ "en") do + @spec build_tags(Comment.t(), String.t()) :: list(Phoenix.HTML.safe()) + def build_tags(%Comment{deleted_at: nil} = comment, _locale) do [ Tag.tag(:meta, property: "og:title", content: comment.actor.preferred_username), Tag.tag(:meta, property: "og:url", content: comment.url), @@ -11,4 +12,6 @@ defimpl Mobilizon.Service.Metadata, for: Mobilizon.Discussions.Comment do Tag.tag(:meta, property: "twitter:card", content: "summary") ] end + + def build_tags(%Comment{} = _comment, _locale), do: [] end