X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmetadata%2Fproviders%2Fopen_graph.ex;h=18ddde84bdffb4da0a3231d5dbbf672ab9e1e2ee;hb=264458531ad1024134fc2f53eded1d1075394536;hp=bb1b23208f8a112e96d923aeb13d7dc4287622e3;hpb=78cea44553c936813ffc2c4c47984a64255096ef;p=akkoma
diff --git a/lib/pleroma/web/metadata/providers/open_graph.ex b/lib/pleroma/web/metadata/providers/open_graph.ex
index bb1b23208..18ddde84b 100644
--- a/lib/pleroma/web/metadata/providers/open_graph.ex
+++ b/lib/pleroma/web/metadata/providers/open_graph.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
@@ -19,31 +19,18 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
}) do
attachments = build_attachments(object)
scrubbed_content = Utils.scrub_html_and_truncate(object)
- # Zero width space
- content =
- if scrubbed_content != "" and scrubbed_content != "\u200B" do
- ": â" <> scrubbed_content <> "â"
- else
- ""
- end
- # Most previews only show og:title which is inconvenient. Instagram
- # hacks this by putting the description in the title and making the
- # description longer prefixed by how many likes and shares the post
- # has. Here we use the descriptive nickname in the title, and expand
- # the full account & nickname in the description. We also use the cute^Wevil
- # smart quotes around the status text like Instagram, too.
[
{:meta,
[
property: "og:title",
- content: "#{user.name}" <> content
+ content: Utils.user_name_string(user)
], []},
{:meta, [property: "og:url", content: url], []},
{:meta,
[
property: "og:description",
- content: "#{Utils.user_name_string(user)}" <> content
+ content: scrubbed_content
], []},
{:meta, [property: "og:type", content: "website"], []}
] ++
@@ -95,8 +82,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
"image" ->
[
{:meta, [property: "og:image", content: Utils.attachment_url(url["href"])], []},
- {:meta, [property: "og:image:width", content: 150], []},
- {:meta, [property: "og:image:height", content: 150], []}
+ {:meta, [property: "og:image:alt", content: attachment["name"]], []}
| acc
]