Apply formatting
This commit is contained in:
parent
5967b30bb1
commit
f6800665e7
|
@ -180,11 +180,17 @@ defmodule Mobilizon.Actors.Actor do
|
||||||
a distant actor.
|
a distant actor.
|
||||||
"""
|
"""
|
||||||
@spec preferred_username_and_domain(t) :: String.t()
|
@spec preferred_username_and_domain(t) :: String.t()
|
||||||
def preferred_username_and_domain(%__MODULE__{preferred_username: preferred_username, domain: nil}) do
|
def preferred_username_and_domain(%__MODULE__{
|
||||||
|
preferred_username: preferred_username,
|
||||||
|
domain: nil
|
||||||
|
}) do
|
||||||
preferred_username
|
preferred_username
|
||||||
end
|
end
|
||||||
|
|
||||||
def preferred_username_and_domain(%__MODULE__{preferred_username: preferred_username, domain: domain}) do
|
def preferred_username_and_domain(%__MODULE__{
|
||||||
|
preferred_username: preferred_username,
|
||||||
|
domain: domain
|
||||||
|
}) do
|
||||||
"#{preferred_username}@#{domain}"
|
"#{preferred_username}@#{domain}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
|
||||||
EventVisibility.create_type()
|
EventVisibility.create_type()
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility"
|
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility USING visibility::event_visibility"
|
||||||
)
|
)
|
||||||
|
|
||||||
JoinOptions.create_type()
|
JoinOptions.create_type()
|
||||||
|
@ -42,7 +42,7 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
|
||||||
EventVisibility.create_type()
|
EventVisibility.create_type()
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility"
|
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility USING visibility::event_visibility"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -115,8 +115,7 @@ defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
|
||||||
test "it works for incoming notices" do
|
test "it works for incoming notices" do
|
||||||
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Jason.decode!()
|
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Jason.decode!()
|
||||||
|
|
||||||
{:ok, %Activity{data: data, local: false}, _} =
|
{:ok, %Activity{data: data, local: false}, _} = Transmogrifier.handle_incoming(data)
|
||||||
Transmogrifier.handle_incoming(data)
|
|
||||||
|
|
||||||
assert data["id"] == "https://framapiaf.org/users/admin/statuses/99512778738411822/activity"
|
assert data["id"] == "https://framapiaf.org/users/admin/statuses/99512778738411822/activity"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue