(Hopefully) improve grammar
[CI skip]
This commit is contained in:
@@ -24,7 +24,7 @@ defmodule Mobilizon.Media do
|
||||
def get_picture!(id), do: Repo.get!(Picture, id)
|
||||
|
||||
@doc """
|
||||
Get a picture by it's URL.
|
||||
Get a picture by its URL.
|
||||
"""
|
||||
@spec get_picture_by_url(String.t()) :: Picture.t() | nil
|
||||
def get_picture_by_url(url) do
|
||||
|
||||
@@ -172,7 +172,7 @@ defmodule MobilizonWeb.Resolvers.Event do
|
||||
{:ok, participant}
|
||||
else
|
||||
{:maximum_attendee_capacity, _} ->
|
||||
{:error, "The event has already reached it's maximum capacity"}
|
||||
{:error, "The event has already reached its maximum capacity"}
|
||||
|
||||
{:has_event, _} ->
|
||||
{:error, "Event with this ID #{inspect(event_id)} doesn't exist"}
|
||||
@@ -329,7 +329,7 @@ defmodule MobilizonWeb.Resolvers.Event do
|
||||
|
||||
# If we have an attached picture, just transmit it. It will be handled by
|
||||
# Mobilizon.Service.ActivityPub.Utils.make_picture_data/1
|
||||
# However, we need to pass it's actor ID
|
||||
# However, we need to pass its actor ID
|
||||
@spec save_attached_picture(map()) :: {:ok, map()}
|
||||
defp save_attached_picture(
|
||||
%{picture: %{picture: %{file: %Plug.Upload{} = _picture} = all_pic}} = args
|
||||
|
||||
@@ -14,7 +14,7 @@ defmodule MobilizonWeb.Resolvers.User do
|
||||
require Logger
|
||||
|
||||
@doc """
|
||||
Find an user by it's ID
|
||||
Find an user by its ID
|
||||
"""
|
||||
def find_user(_parent, %{id: id}, _resolution) do
|
||||
Users.get_user_with_actors(id)
|
||||
@@ -128,7 +128,7 @@ defmodule MobilizonWeb.Resolvers.User do
|
||||
end
|
||||
|
||||
@doc """
|
||||
Validate an user, get it's actor and a token
|
||||
Validate an user, get its actor and a token
|
||||
"""
|
||||
def validate_user(_parent, %{token: token}, _resolution) do
|
||||
with {:check_confirmation_token, {:ok, %User{} = user}} <-
|
||||
|
||||
@@ -89,7 +89,7 @@ defmodule MobilizonWeb.Schema.Actors.GroupType do
|
||||
resolve(&Group.list_groups/3)
|
||||
end
|
||||
|
||||
@desc "Get a group by it's preferred username"
|
||||
@desc "Get a group by its preferred username"
|
||||
field :group, :group do
|
||||
arg(:preferred_username, non_null(:string))
|
||||
resolve(&Group.find_group/3)
|
||||
|
||||
@@ -70,13 +70,13 @@ defmodule MobilizonWeb.Schema.Actors.PersonType do
|
||||
resolve(&Person.get_current_person/3)
|
||||
end
|
||||
|
||||
@desc "Get a person by it's (federated) username"
|
||||
@desc "Get a person by its (federated) username"
|
||||
field :fetch_person, :person do
|
||||
arg(:preferred_username, non_null(:string))
|
||||
resolve(&Person.fetch_person/3)
|
||||
end
|
||||
|
||||
@desc "Get a person by it's ID"
|
||||
@desc "Get a person by its ID"
|
||||
field :person, :person do
|
||||
arg(:id, non_null(:id))
|
||||
resolve(&Person.get_person/3)
|
||||
|
||||
@@ -480,7 +480,7 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||
end
|
||||
|
||||
@doc """
|
||||
Create an actor locally by it's URL (AP ID)
|
||||
Create an actor locally by its URL (AP ID)
|
||||
"""
|
||||
@spec make_actor_from_url(String.t(), boolean()) :: {:ok, %Actor{}} | {:error, any()}
|
||||
def make_actor_from_url(url, preload \\ false) do
|
||||
@@ -520,7 +520,7 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||
def find_or_make_group_from_nickname(nick), do: find_or_make_actor_from_nickname(nick, :Group)
|
||||
|
||||
@doc """
|
||||
Create an actor inside our database from username, using WebFinger to find out it's AP ID and then fetch it
|
||||
Create an actor inside our database from username, using WebFinger to find out its AP ID and then fetch it
|
||||
"""
|
||||
@spec make_actor_from_nickname(String.t()) :: {:ok, %Actor{}} | {:error, any()}
|
||||
def make_actor_from_nickname(nickname) do
|
||||
@@ -611,7 +611,7 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||
)
|
||||
end
|
||||
|
||||
# Fetching a remote actor's information through it's AP ID
|
||||
# Fetching a remote actor's information through its AP ID
|
||||
@spec fetch_and_prepare_actor_from_url(String.t()) :: {:ok, struct()} | {:error, atom()} | any()
|
||||
defp fetch_and_prepare_actor_from_url(url) do
|
||||
Logger.debug("Fetching and preparing actor from url")
|
||||
|
||||
@@ -54,7 +54,7 @@ defmodule Mobilizon.Service.Export.Feed do
|
||||
end
|
||||
end
|
||||
|
||||
# Build an atom feed from actor and it's public events
|
||||
# Build an atom feed from actor and its public events
|
||||
@spec build_actor_feed(Actor.t(), list(), boolean()) :: String.t()
|
||||
defp build_actor_feed(%Actor{} = actor, events, public \\ true) do
|
||||
display_name = Actor.display_name(actor)
|
||||
@@ -159,7 +159,7 @@ defmodule Mobilizon.Service.Export.Feed do
|
||||
|> Enum.map(&Events.get_event_with_preload!/1)
|
||||
end
|
||||
|
||||
# Build an atom feed from actor and it's public events
|
||||
# Build an atom feed from actor and its public events
|
||||
@spec build_user_feed(list(), User.t(), String.t()) :: String.t()
|
||||
defp build_user_feed(events, %User{email: email}, token) do
|
||||
self_url = Endpoint |> Routes.feed_url(:going, token, "atom") |> URI.decode()
|
||||
|
||||
Reference in New Issue
Block a user