Apply formatting

This commit is contained in:
miffigriffy 2019-09-13 02:28:09 +02:00
parent 5967b30bb1
commit f6800665e7
3 changed files with 11 additions and 6 deletions

View file

@ -180,11 +180,17 @@ defmodule Mobilizon.Actors.Actor do
a distant actor.
"""
@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
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}"
end

View file

@ -14,7 +14,7 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
EventVisibility.create_type()
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()
@ -42,7 +42,7 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
EventVisibility.create_type()
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

View file

@ -115,8 +115,7 @@ defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
test "it works for incoming notices" do
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Jason.decode!()
{:ok, %Activity{data: data, local: false}, _} =
Transmogrifier.handle_incoming(data)
{:ok, %Activity{data: data, local: false}, _} = Transmogrifier.handle_incoming(data)
assert data["id"] == "https://framapiaf.org/users/admin/statuses/99512778738411822/activity"