diff --git a/lib/pleroma/hashtag.ex b/lib/pleroma/hashtag.ex index 29e95e3a03..3682f0c140 100644 --- a/lib/pleroma/hashtag.ex +++ b/lib/pleroma/hashtag.ex @@ -10,9 +10,9 @@ defmodule Pleroma.Hashtag do alias Ecto.Multi alias Pleroma.Hashtag - alias Pleroma.User.HashtagFollow alias Pleroma.Object alias Pleroma.Repo + alias Pleroma.User.HashtagFollow schema "hashtags" do field(:name, :string) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 2141948fc0..d5c8f2bf38 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -21,7 +21,6 @@ defmodule Pleroma.User do alias Pleroma.FollowingRelationship alias Pleroma.Formatter alias Pleroma.Hashtag - alias Pleroma.User.HashtagFollow alias Pleroma.HTML alias Pleroma.Keys alias Pleroma.MFA @@ -31,6 +30,7 @@ defmodule Pleroma.User do alias Pleroma.Repo alias Pleroma.User alias Pleroma.UserRelationship + alias Pleroma.User.HashtagFollow alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.Pipeline @@ -1167,7 +1167,7 @@ def needs_update?(_), do: true # "Locked" (self-locked) users demand explicit authorization of follow requests @spec can_direct_follow_local(User.t(), User.t()) :: true | false def can_direct_follow_local(%User{} = follower, %User{local: true} = followed) do - !followed.is_locked || (followed.permit_followback and is_friend_of(follower, followed)) + !followed.is_locked || (followed.permit_followback and friend_of?(follower, followed)) end @spec maybe_direct_follow(User.t(), User.t()) :: @@ -1552,7 +1552,7 @@ def get_familiar_followers(%User{} = user, %User{} = current_user, page \\ nil) |> Repo.all() end - def is_friend_of(%User{} = potential_friend, %User{local: true} = user) do + def friend_of?(%User{} = potential_friend, %User{local: true} = user) do user |> get_friends_query() |> where(id: ^potential_friend.id) diff --git a/lib/pleroma/user/hashtag_follow.ex b/lib/pleroma/user/hashtag_follow.ex index dd0254ef4c..3e28b130b4 100644 --- a/lib/pleroma/user/hashtag_follow.ex +++ b/lib/pleroma/user/hashtag_follow.ex @@ -3,9 +3,9 @@ defmodule Pleroma.User.HashtagFollow do import Ecto.Query import Ecto.Changeset - alias Pleroma.User alias Pleroma.Hashtag alias Pleroma.Repo + alias Pleroma.User schema "user_follows_hashtag" do belongs_to(:user, User, type: FlakeId.Ecto.CompatType) diff --git a/lib/pleroma/web/api_spec/operations/akkoma_compat_operation.ex b/lib/pleroma/web/api_spec/operations/akkoma_compat_operation.ex index 83d29caf9b..3f38e54e64 100644 --- a/lib/pleroma/web/api_spec/operations/akkoma_compat_operation.ex +++ b/lib/pleroma/web/api_spec/operations/akkoma_compat_operation.ex @@ -13,7 +13,7 @@ def open_api_operation(action) do end # Adapted from https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/lib/pleroma/web/api_spec/operations/translate_operation.ex - def translation_languages_operation() do + def translation_languages_operation do %Operation{ tags: ["Akkoma compatibility routes"], summary: "Get translation languages", @@ -54,7 +54,7 @@ defp languages_schema do } end - def translate_operation() do + def translate_operation do %Operation{ tags: ["Akkoma compatibility routes"], summary: "Translate status", diff --git a/lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex b/lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex index 46f07f3bf1..a15029d92d 100644 --- a/lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex @@ -8,10 +8,10 @@ defmodule Pleroma.Web.MastodonAPI.FollowRequestController do import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2] + alias Pleroma.Pagination alias Pleroma.User alias Pleroma.Web.CommonAPI alias Pleroma.Web.Plugs.OAuthScopesPlug - alias Pleroma.Pagination plug(Pleroma.Web.ApiSpec.CastAndValidate, replace_params: false) plug(:assign_follower when action != :index) diff --git a/lib/pleroma/web/mastodon_api/controllers/tag_controller.ex b/lib/pleroma/web/mastodon_api/controllers/tag_controller.ex index ca5ee48ac1..21c21e984d 100644 --- a/lib/pleroma/web/mastodon_api/controllers/tag_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/tag_controller.ex @@ -2,9 +2,9 @@ defmodule Pleroma.Web.MastodonAPI.TagController do @moduledoc "Hashtag routes for mastodon API" use Pleroma.Web, :controller - alias Pleroma.User alias Pleroma.Hashtag alias Pleroma.Pagination + alias Pleroma.User import Pleroma.Web.ControllerHelper, only: [