Event changeset more cleaner

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-12-03 12:29:31 +01:00
parent dd87ad4f7e
commit c6e6a61000
2 changed files with 37 additions and 17 deletions

View File

@@ -322,4 +322,13 @@ defmodule Mobilizon.Actors.Actor do
|> Enum.map(& &1.actor_id)
|> Enum.member?(follower_actor_id)
end
@spec actor_acct_from_actor(struct()) :: String.t()
def actor_acct_from_actor(%Actor{preferred_username: preferred_username, domain: domain}) do
if is_nil(domain) do
preferred_username
else
"#{preferred_username}@#{domain}"
end
end
end