@@ -190,7 +190,10 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
|
||||
description: "The page in the paginated activity items list"
|
||||
)
|
||||
|
||||
arg(:limit, :integer, default_value: 10, description: "The limit of activity items per page")
|
||||
arg(:limit, :integer,
|
||||
default_value: 10,
|
||||
description: "The limit of activity items per page"
|
||||
)
|
||||
|
||||
arg(:type, :activity_type, description: "Filter by type of activity")
|
||||
arg(:author, :activity_author, description: "Filter by activity author")
|
||||
@@ -213,7 +216,9 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
|
||||
enum :openness do
|
||||
value(:invite_only, description: "The actor can only be followed by invitation")
|
||||
|
||||
value(:moderated, description: "The actor needs to accept the following before it's effective")
|
||||
value(:moderated,
|
||||
description: "The actor needs to accept the following before it's effective"
|
||||
)
|
||||
|
||||
value(:open, description: "The actor is open to followings")
|
||||
end
|
||||
|
||||
@@ -26,7 +26,9 @@ defmodule Mobilizon.GraphQL.Schema.Actors.PersonType do
|
||||
resolve: &Person.user_for_person/3
|
||||
)
|
||||
|
||||
field(:member_of, list_of(:member), description: "The list of groups this person is member of")
|
||||
field(:member_of, list_of(:member),
|
||||
description: "The list of groups this person is member of"
|
||||
)
|
||||
|
||||
field(:url, :string, description: "The ActivityPub actor's URL")
|
||||
field(:type, :actor_type, description: "The type of Actor (Person, Group,…)")
|
||||
@@ -94,7 +96,10 @@ defmodule Mobilizon.GraphQL.Schema.Actors.PersonType do
|
||||
description: "The page in the paginated participation list"
|
||||
)
|
||||
|
||||
arg(:limit, :integer, default_value: 10, description: "The limit of participations per page")
|
||||
arg(:limit, :integer,
|
||||
default_value: 10,
|
||||
description: "The limit of participations per page"
|
||||
)
|
||||
|
||||
resolve(&Person.person_participations/3)
|
||||
end
|
||||
@@ -218,7 +223,10 @@ defmodule Mobilizon.GraphQL.Schema.Actors.PersonType do
|
||||
field :create_person, :person do
|
||||
arg(:preferred_username, non_null(:string), description: "The username for the profile")
|
||||
|
||||
arg(:name, :string, description: "The displayed name for the new profile", default_value: "")
|
||||
arg(:name, :string,
|
||||
description: "The displayed name for the new profile",
|
||||
default_value: ""
|
||||
)
|
||||
|
||||
arg(:summary, :string, description: "The summary for the new profile", default_value: "")
|
||||
|
||||
@@ -286,7 +294,10 @@ defmodule Mobilizon.GraphQL.Schema.Actors.PersonType do
|
||||
field :register_person, :person do
|
||||
arg(:preferred_username, non_null(:string), description: "The username for the profile")
|
||||
|
||||
arg(:name, :string, description: "The displayed name for the new profile", default_value: "")
|
||||
arg(:name, :string,
|
||||
description: "The displayed name for the new profile",
|
||||
default_value: ""
|
||||
)
|
||||
|
||||
arg(:summary, :string, description: "The summary for the new profile", default_value: "")
|
||||
arg(:email, non_null(:string), description: "The email from the user previously created")
|
||||
@@ -301,7 +312,11 @@ defmodule Mobilizon.GraphQL.Schema.Actors.PersonType do
|
||||
"The banner for the profile, either as an object or directly the ID of an existing media"
|
||||
)
|
||||
|
||||
middleware(Rajska.QueryAuthorization, permit: :all, scope: Mobilizon.Actors.Actor, args: %{})
|
||||
middleware(Rajska.QueryAuthorization,
|
||||
permit: :all,
|
||||
scope: Mobilizon.Actors.Actor,
|
||||
args: %{}
|
||||
)
|
||||
|
||||
resolve(&Person.register_person/3)
|
||||
end
|
||||
|
||||
@@ -102,7 +102,10 @@ defmodule Mobilizon.GraphQL.Schema.AddressType do
|
||||
description: "The page in the paginated search results list"
|
||||
)
|
||||
|
||||
arg(:limit, :integer, default_value: 10, description: "The limit of search results per page")
|
||||
arg(:limit, :integer,
|
||||
default_value: 10,
|
||||
description: "The limit of search results per page"
|
||||
)
|
||||
|
||||
arg(:type, :address_search_type, description: "Filter by type of results")
|
||||
middleware(Rajska.QueryAuthorization, permit: :all)
|
||||
|
||||
@@ -96,7 +96,9 @@ defmodule Mobilizon.GraphQL.Schema.Discussions.CommentType do
|
||||
arg(:in_reply_to_comment_id, :id, description: "The comment ID this one replies to")
|
||||
arg(:language, :string, description: "The comment language", default_value: "und")
|
||||
|
||||
arg(:is_announcement, :boolean, description: "Should this comment be announced to everyone?")
|
||||
arg(:is_announcement, :boolean,
|
||||
description: "Should this comment be announced to everyone?"
|
||||
)
|
||||
|
||||
middleware(Rajska.QueryAuthorization,
|
||||
permit: :user,
|
||||
@@ -114,7 +116,9 @@ defmodule Mobilizon.GraphQL.Schema.Discussions.CommentType do
|
||||
arg(:comment_id, non_null(:id), description: "The comment ID")
|
||||
arg(:language, :string, description: "The comment language", default_value: "und")
|
||||
|
||||
arg(:is_announcement, :boolean, description: "Should this comment be announced to everyone?")
|
||||
arg(:is_announcement, :boolean,
|
||||
description: "Should this comment be announced to everyone?"
|
||||
)
|
||||
|
||||
middleware(Rajska.QueryAuthorization,
|
||||
permit: :user,
|
||||
|
||||
@@ -230,7 +230,9 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
|
||||
description: "Whether or not to allow anonymous participation (if the server allows it)"
|
||||
)
|
||||
|
||||
field(:offers, list_of(:event_offer), description: "The list of offers to show for this event")
|
||||
field(:offers, list_of(:event_offer),
|
||||
description: "The list of offers to show for this event"
|
||||
)
|
||||
|
||||
field(:participation_conditions, list_of(:event_participation_condition),
|
||||
description: "The list of participation conditions to accept to join this event"
|
||||
@@ -414,7 +416,9 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
|
||||
description: "The event's organizer ID (as a person)"
|
||||
)
|
||||
|
||||
arg(:attributed_to_id, :id, description: "Who the event is attributed to ID (often a group)")
|
||||
arg(:attributed_to_id, :id,
|
||||
description: "Who the event is attributed to ID (often a group)"
|
||||
)
|
||||
|
||||
arg(:category, :event_category,
|
||||
default_value: "MEETING",
|
||||
@@ -476,7 +480,9 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
|
||||
arg(:phone_address, :string, description: "Phone address for the event")
|
||||
arg(:organizer_actor_id, :id, description: "The event's organizer ID (as a person)")
|
||||
|
||||
arg(:attributed_to_id, :id, description: "Who the event is attributed to ID (often a group)")
|
||||
arg(:attributed_to_id, :id,
|
||||
description: "Who the event is attributed to ID (often a group)"
|
||||
)
|
||||
|
||||
arg(:category, :event_category, description: "The event's category")
|
||||
arg(:physical_address, :address_input, description: "The event's physical address")
|
||||
|
||||
@@ -25,7 +25,10 @@ defmodule Mobilizon.GraphQL.Schema.ResourceType do
|
||||
field(:type, :string, description: "The resource's type (if it's a folder)")
|
||||
field(:path, :string, description: "The resource's path")
|
||||
|
||||
field(:parent, :resource, description: "The resource's parent", resolve: dataloader(Resources))
|
||||
field(:parent, :resource,
|
||||
description: "The resource's parent",
|
||||
resolve: dataloader(Resources)
|
||||
)
|
||||
|
||||
field :children, :paginated_resource_list do
|
||||
description("Children resources in folder")
|
||||
|
||||
@@ -73,7 +73,9 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
|
||||
description: "The list of participations this user has",
|
||||
meta: [private: true, rule: :"read:user:participations"]
|
||||
) do
|
||||
arg(:after_datetime, :datetime, description: "Filter participations by event start datetime")
|
||||
arg(:after_datetime, :datetime,
|
||||
description: "Filter participations by event start datetime"
|
||||
)
|
||||
|
||||
arg(:before_datetime, :datetime, description: "Filter participations by event end datetime")
|
||||
|
||||
@@ -148,7 +150,9 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
|
||||
|
||||
field(:last_sign_in_at, :datetime, description: "When the user previously signed-in")
|
||||
|
||||
field(:last_sign_in_ip, :string, description: "The IP adress the user previously sign-in with")
|
||||
field(:last_sign_in_ip, :string,
|
||||
description: "The IP adress the user previously sign-in with"
|
||||
)
|
||||
|
||||
field(:current_sign_in_at, :datetime, description: "When the user currenlty signed-in")
|
||||
|
||||
|
||||
@@ -1310,7 +1310,9 @@ defmodule Mobilizon.Actors do
|
||||
def schedule_key_rotation(%Actor{id: actor_id} = actor, delay) do
|
||||
Cachex.put(:actor_key_rotation, actor_id, true)
|
||||
|
||||
Workers.Background.enqueue("actor_key_rotation", %{"actor_id" => actor.id}, schedule_in: delay)
|
||||
Workers.Background.enqueue("actor_key_rotation", %{"actor_id" => actor.id},
|
||||
schedule_in: delay
|
||||
)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
@@ -108,7 +108,7 @@ defmodule Mobilizon.Events.Participant do
|
||||
end
|
||||
|
||||
# No lookalike symbols
|
||||
@symbols '6789BCDFGHJKLMNPQRTW'
|
||||
@symbols ~c"6789BCDFGHJKLMNPQRTW"
|
||||
@symbol_count Enum.count(@symbols) - 1
|
||||
@code_length 6
|
||||
|
||||
|
||||
@@ -183,15 +183,15 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticator do
|
||||
|
||||
@spec search_filter(String.t(), boolean()) :: any()
|
||||
defp search_filter(email, false) do
|
||||
:eldap.equalityMatch('mail', to_charlist(email))
|
||||
:eldap.equalityMatch(~c"mail", to_charlist(email))
|
||||
end
|
||||
|
||||
# If we need to filter for group memberships as well
|
||||
@spec search_filter(String.t(), String.t()) :: any()
|
||||
defp search_filter(email, group) when is_binary(group) do
|
||||
:eldap.and([
|
||||
:eldap.equalityMatch('mail', to_charlist(email)),
|
||||
:eldap.equalityMatch('memberOf', to_charlist(group))
|
||||
:eldap.equalityMatch(~c"mail", to_charlist(email)),
|
||||
:eldap.equalityMatch(~c"memberOf", to_charlist(group))
|
||||
])
|
||||
end
|
||||
|
||||
|
||||
@@ -7,7 +7,10 @@ defimpl Mobilizon.Service.Metadata, for: Mobilizon.Discussions.Comment do
|
||||
@spec build_tags(Comment.t(), String.t()) :: list(Phoenix.HTML.safe())
|
||||
def build_tags(%Comment{deleted_at: nil} = comment, _locale) do
|
||||
[
|
||||
Tag.tag(:meta, property: "og:title", content: escape_text(Actor.display_name(comment.actor))),
|
||||
Tag.tag(:meta,
|
||||
property: "og:title",
|
||||
content: escape_text(Actor.display_name(comment.actor))
|
||||
),
|
||||
Tag.tag(:meta, property: "og:url", content: comment.url),
|
||||
Tag.tag(:meta, property: "og:description", content: comment.text),
|
||||
Tag.tag(:meta, property: "og:type", content: "website"),
|
||||
|
||||
Reference in New Issue
Block a user