aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-01-15 21:20:27 +0300
committerrinpatch <rinpatch@sdf.org>2019-01-15 21:20:27 +0300
commite8eecd61b4714406501fa0c5335ba53e19ee0bae (patch)
tree43a23671dcd2ac77a5446f248202a3bed7d7d6fe
parent410fd9d774fb3437a38adfe405ff45d4950b51a9 (diff)
downloadpleroma-e8eecd61b4714406501fa0c5335ba53e19ee0bae.tar.gz
Formating
-rw-r--r--lib/pleroma/web/metadata/opengraph.ex15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/pleroma/web/metadata/opengraph.ex b/lib/pleroma/web/metadata/opengraph.ex
index 2eac04ae7..be7b155d5 100644
--- a/lib/pleroma/web/metadata/opengraph.ex
+++ b/lib/pleroma/web/metadata/opengraph.ex
@@ -9,6 +9,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
def build_tags(%{activity: activity, user: user}) do
with truncated_content = scrub_html_and_truncate(activity.data["object"]["content"]) do
attachments = build_attachments(activity)
+
[
{:meta,
[
@@ -18,10 +19,16 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
{:meta, [property: "og:url", content: activity.data["id"]], []},
{:meta, [property: "og:description", content: truncated_content], []},
{:meta, [property: "twitter:card", content: "summary"], []}
- ] ++ if attachments == [] do [
- {:meta, [property: "og:image", content: attachment_url(User.avatar_url(user))], []},
- {:meta, [property: "og:image:width", content: 120], []},
- {:meta, [property: "og:image:height", content: 120], []} ] else attachments end
+ ] ++
+ if attachments == [] do
+ [
+ {:meta, [property: "og:image", content: attachment_url(User.avatar_url(user))], []},
+ {:meta, [property: "og:image:width", content: 120], []},
+ {:meta, [property: "og:image:height", content: 120], []}
+ ]
+ else
+ attachments
+ end
end
end