projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags...
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
transmogrifier.ex
diff --git
a/lib/pleroma/web/activity_pub/transmogrifier.ex
b/lib/pleroma/web/activity_pub/transmogrifier.ex
index dd0e1f13c61800b5ad9800fb42a946533da4c5f7..0a701334f00d08f7f57e2a8ac963e2e526414c2e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/
lib/pleroma/web/activity_pub/transmogrifier.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.ActivityPub.Transmogrifier do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
@@
-32,18
+32,18
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
"""
def fix_object(object, options \\ []) do
object
"""
def fix_object(object, options \\ []) do
object
- |> strip_internal_fields
- |> fix_actor
- |> fix_url
- |> fix_attachments
- |> fix_context
+ |> strip_internal_fields
()
+ |> fix_actor
()
+ |> fix_url
()
+ |> fix_attachments
()
+ |> fix_context
()
|> fix_in_reply_to(options)
|> fix_in_reply_to(options)
- |> fix_emoji
- |> fix_tag
- |> set_sensitive
- |> fix_content_map
- |> fix_addressing
- |> fix_summary
+ |> fix_emoji
()
+ |> fix_tag
()
+ |> set_sensitive
()
+ |> fix_content_map
()
+ |> fix_addressing
()
+ |> fix_summary
()
|> fix_type(options)
end
|> fix_type(options)
end
@@
-315,10
+315,9
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
tags =
tag
|> Enum.filter(fn data -> data["type"] == "Hashtag" and data["name"] end)
tags =
tag
|> Enum.filter(fn data -> data["type"] == "Hashtag" and data["name"] end)
- |> Enum.map(fn %{"name" => name} ->
- name
- |> String.slice(1..-1)
- |> String.downcase()
+ |> Enum.map(fn
+ %{"name" => "#" <> hashtag} -> String.downcase(hashtag)
+ %{"name" => hashtag} -> String.downcase(hashtag)
end)
Map.put(object, "tag", tag ++ tags)
end)
Map.put(object, "tag", tag ++ tags)
@@
-921,7
+920,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
defp build_emoji_tag({name, url}) do
%{
defp build_emoji_tag({name, url}) do
%{
- "icon" => %{"url" =>
url
, "type" => "Image"},
+ "icon" => %{"url" =>
"#{URI.encode(url)}"
, "type" => "Image"},
"name" => ":" <> name <> ":",
"type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z",
"name" => ":" <> name <> ":",
"type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z",