projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set the correct height/width if the data is available when generating twittercard...
[akkoma]
/
lib
/
pleroma
/
web
/
views
/
embed_view.ex
diff --git
a/lib/pleroma/web/views/embed_view.ex
b/lib/pleroma/web/views/embed_view.ex
index 77536835bf7cc7fac5aed38ef8b72988cf01819f..81e19673038d46e052378512ffcc71895dd5dd77 100644
(file)
--- a/
lib/pleroma/web/views/embed_view.ex
+++ b/
lib/pleroma/web/views/embed_view.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.EmbedView do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.EmbedView do
@@
-17,16
+17,9
@@
defmodule Pleroma.Web.EmbedView do
use Phoenix.HTML
use Phoenix.HTML
- @media_types ["image", "audio", "video"]
+ defdelegate full_nickname(user), to: User
- defp emoji_for_user(%User{} = user) do
- user.source_data
- |> Map.get("tag", [])
- |> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
- |> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
- {String.trim(name, ":"), url}
- end)
- end
+ @media_types ["image", "audio", "video"]
defp fetch_media_type(%{"mediaType" => mediaType}) do
Utils.fetch_media_type(@media_types, mediaType)
defp fetch_media_type(%{"mediaType" => mediaType}) do
Utils.fetch_media_type(@media_types, mediaType)
@@
-39,11
+32,6
@@
defmodule Pleroma.Web.EmbedView do
)
end
)
end
- defp full_nickname(user) do
- %{host: host} = URI.parse(user.ap_id)
- "@" <> user.nickname <> "@" <> host
- end
-
defp status_title(%Activity{object: %Object{data: %{"name" => name}}}) when is_binary(name),
do: name
defp status_title(%Activity{object: %Object{data: %{"name" => name}}}) when is_binary(name),
do: name