mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Fix rendering metadata from deleted (empty) comments
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
e9e12500dc
commit
acbe0e6c59
1 changed files with 4 additions and 1 deletions
|
@ -2,7 +2,8 @@ defimpl Mobilizon.Service.Metadata, for: Mobilizon.Discussions.Comment do
|
||||||
alias Phoenix.HTML.Tag
|
alias Phoenix.HTML.Tag
|
||||||
alias Mobilizon.Discussions.Comment
|
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:title", content: comment.actor.preferred_username),
|
||||||
Tag.tag(:meta, property: "og:url", content: comment.url),
|
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")
|
Tag.tag(:meta, property: "twitter:card", content: "summary")
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def build_tags(%Comment{} = _comment, _locale), do: []
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue