Decode URI sent in notification payloads
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
d1c31a5080
commit
691d71d9f7
@ -70,12 +70,13 @@ defmodule Mobilizon.Service.Activity.Renderer.Discussion do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp discussion_url(activity) do
|
defp discussion_url(activity) do
|
||||||
Routes.page_url(
|
Endpoint
|
||||||
Endpoint,
|
|> Routes.page_url(
|
||||||
:discussion,
|
:discussion,
|
||||||
Actor.preferred_username_and_domain(activity.group),
|
Actor.preferred_username_and_domain(activity.group),
|
||||||
activity.subject_params["discussion_slug"]
|
activity.subject_params["discussion_slug"]
|
||||||
)
|
)
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
@ -71,11 +71,12 @@ defmodule Mobilizon.Service.Activity.Renderer.Event do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp event_url(activity) do
|
defp event_url(activity) do
|
||||||
Routes.page_url(
|
Endpoint
|
||||||
Endpoint,
|
|> Routes.page_url(
|
||||||
:event,
|
:event,
|
||||||
activity.subject_params["event_uuid"]
|
activity.subject_params["event_uuid"]
|
||||||
)
|
)
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
@ -50,7 +50,9 @@ defmodule Mobilizon.Service.Activity.Renderer.Group do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp post_url(activity) do
|
defp post_url(activity) do
|
||||||
Routes.page_url(Endpoint, :post, activity.subject_params["post_slug"])
|
Endpoint
|
||||||
|
|> Routes.page_url(:post, activity.subject_params["post_slug"])
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
@ -63,12 +63,13 @@ defmodule Mobilizon.Service.Activity.Renderer.Member do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp member_url(activity) do
|
defp member_url(activity) do
|
||||||
Routes.page_url(
|
Endpoint
|
||||||
Endpoint,
|
|> Routes.page_url(
|
||||||
:discussion,
|
:discussion,
|
||||||
Actor.preferred_username_and_domain(activity.group),
|
Actor.preferred_username_and_domain(activity.group),
|
||||||
activity.subject_params["discussion_slug"]
|
activity.subject_params["discussion_slug"]
|
||||||
)
|
)
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
@ -70,12 +70,13 @@ defmodule Mobilizon.Service.Activity.Renderer.Post do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp discussion_url(activity) do
|
defp discussion_url(activity) do
|
||||||
Routes.page_url(
|
Endpoint
|
||||||
Endpoint,
|
|> Routes.page_url(
|
||||||
:discussion,
|
:discussion,
|
||||||
Actor.preferred_username_and_domain(activity.group),
|
Actor.preferred_username_and_domain(activity.group),
|
||||||
activity.subject_params["discussion_slug"]
|
activity.subject_params["discussion_slug"]
|
||||||
)
|
)
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
@ -114,7 +114,9 @@ defmodule Mobilizon.Service.Activity.Renderer.Resource do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp resource_url(activity) do
|
defp resource_url(activity) do
|
||||||
Routes.page_url(Endpoint, :resource, activity.subject_params["resource_uuid"])
|
Endpoint
|
||||||
|
|> Routes.page_url(:resource, activity.subject_params["resource_uuid"])
|
||||||
|
|> URI.decode()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
defp profile(activity), do: Actor.display_name_and_username(activity.author)
|
||||||
|
Loading…
Reference in New Issue
Block a user