# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha do
- alias Plug.Crypto.KeyGenerator
- alias Plug.Crypto.MessageEncryptor
+ alias Plug.Crypto.{KeyGenerator, MessageEncryptor}
alias Calendar.DateTime
use GenServer
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Formatter do
- alias Pleroma.User
+ alias Pleroma.{Emoji, HTML, User}
alias Pleroma.Web.MediaProxy
- alias Pleroma.HTML
- alias Pleroma.Emoji
@tag_regex ~r/((?<=[^&])|\A)(\#)(\w+)/u
@markdown_characters_regex ~r/(`|\*|_|{|}|[|]|\(|\)|#|\+|-|\.|!)/
defmodule Pleroma.Gopher.Server.ProtocolHandler do
alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.User
- alias Pleroma.Activity
- alias Pleroma.Repo
- alias Pleroma.HTML
+ alias Pleroma.{Activity, HTML, User, Repo}
def start_link(ref, socket, transport, opts) do
pid = spawn_link(__MODULE__, :init, [ref, socket, transport, opts])
@doc "The default HTML scrubbing policy: no "
require HtmlSanitizeEx.Scrubber.Meta
+
alias HtmlSanitizeEx.Scrubber.Meta
@markup Application.get_env(:pleroma, :markup)
defmodule Pleroma.Instances.Instance do
@moduledoc "Instance."
- alias Pleroma.Instances
+ alias Pleroma.{Instances, Repo}
alias Pleroma.Instances.Instance
use Ecto.Schema
import Ecto.{Query, Changeset}
- alias Pleroma.Repo
-
schema "instances" do
field(:host, :string)
field(:unreachable_since, :naive_datetime)
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserFetcherPlug do
+ alias Pleroma.{User, Repo}
+
import Plug.Conn
- alias Pleroma.Repo
- alias Pleroma.User
def init(options) do
options
import Ecto.Changeset
- alias Pleroma.UserInviteToken
- alias Pleroma.Repo
+ alias Pleroma.{UserInviteToken, Repo}
schema "user_invite_tokens" do
field(:token, :string)
defmodule Pleroma.Web.ActivityPub.ActivityPub do
alias Pleroma.{Activity, Repo, Object, Upload, User, Notification, Instances}
alias Pleroma.Web.ActivityPub.{Transmogrifier, MRF}
- alias Pleroma.Web.WebFinger
- alias Pleroma.Web.Federator
- alias Pleroma.Web.OStatus
+ alias Pleroma.Web.{WebFinger, Federator, OStatus}
+
import Ecto.Query
import Pleroma.Web.ActivityPub.Utils
+
require Logger
@httpoison Application.get_env(:pleroma, :httpoison)
alias Pleroma.{Activity, User, Object}
alias Pleroma.Web.ActivityPub.{ObjectView, UserView}
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Relay
- alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.Web.ActivityPub.Transmogrifier
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Relay, Transmogrifier, Utils}
alias Pleroma.Web.Federator
require Logger
@moduledoc """
A module to handle coding from internal to wire ActivityPub and back.
"""
- alias Pleroma.User
- alias Pleroma.Object
- alias Pleroma.Activity
- alias Pleroma.Repo
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Utils
+ alias Pleroma.{Activity, User, Object, Repo}
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Utils}
import Ecto.Query
defmodule Pleroma.Web.ActivityPub.UserView do
use Pleroma.Web, :view
- alias Pleroma.Web.Salmon
- alias Pleroma.Web.WebFinger
- alias Pleroma.User
- alias Pleroma.Repo
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Transmogrifier
- alias Pleroma.Web.ActivityPub.Utils
+
+ alias Pleroma.Web.{WebFinger, Salmon}
+ alias Pleroma.{User, Repo}
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Transmogrifier, Utils}
+
import Ecto.Query
# the instance itself is not a Person, but instead an Application
defmodule Pleroma.Web.CommonAPI do
alias Pleroma.{User, Repo, Activity, Object}
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Utils
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Utils}
alias Pleroma.Formatter
import Pleroma.Web.CommonAPI.Utils
alias Comeonin.Pbkdf2
alias Pleroma.{Activity, Formatter, Object, Repo}
alias Pleroma.{User, Web}
+ alias Pleroma.Web.{Endpoint, MediaProxy}
alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.Web.Endpoint
- alias Pleroma.Web.MediaProxy
# This is a hack for twidere.
def get_by_id_or_ap_id(id) do
defmodule Pleroma.Web.Federator do
use GenServer
- alias Pleroma.User
- alias Pleroma.Activity
+
+ alias Pleroma.{Activity, User}
alias Pleroma.Web.{WebFinger, Websub, Salmon}
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Relay, Transmogrifier, Utils}
alias Pleroma.Web.Federator.RetryQueue
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Relay
- alias Pleroma.Web.ActivityPub.Transmogrifier
- alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.OStatus
+
require Logger
@websub Application.get_env(:pleroma, :websub)
# https://tools.ietf.org/html/draft-cavage-http-signatures-08
defmodule Pleroma.Web.HTTPSignatures do
alias Pleroma.User
- alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Utils}
+
require Logger
def split_signature(sig) do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
- alias Pleroma.Web.Metadata.Providers.Provider
- alias Pleroma.Web.Metadata
alias Pleroma.{HTML, Formatter, User}
- alias Pleroma.Web.MediaProxy
+ alias Pleroma.Web.{Metadata, MediaProxy}
+ alias Pleroma.Web.Metadata.Providers.Provider
@behaviour Provider
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.OStatus.FeedRepresenter do
- alias Pleroma.Web.OStatus
- alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
alias Pleroma.User
- alias Pleroma.Web.MediaProxy
+ alias Pleroma.Web.{OStatus, MediaProxy}
+ alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
def to_simple_form(user, activities, _users) do
most_recent_update =
require Logger
alias Pleroma.Web.{XML, OStatus}
alias Pleroma.{Object, Activity}
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Utils
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Utils}
alias Pleroma.Web.CommonAPI
@doc """
require Logger
alias Pleroma.{Repo, User, Web, Object, Activity}
- alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Transmogrifier}
alias Pleroma.Web.{WebFinger, Websub}
alias Pleroma.Web.OStatus.{FollowHandler, UnfollowHandler, NoteHandler, DeleteHandler}
- alias Pleroma.Web.ActivityPub.Transmogrifier
def is_representable?(%Activity{data: data}) do
object = Object.normalize(data["object"])
defmodule Pleroma.Web.OStatus.OStatusController do
use Pleroma.Web, :controller
- alias Pleroma.{User, Activity, Object}
- alias Pleroma.Web.OStatus.{FeedRepresenter, ActivityRepresenter}
- alias Pleroma.Web.{OStatus, Federator}
+ alias Pleroma.{Activity, Object, User}
+ alias Pleroma.Web.ActivityPub.{ActivityPub, ActivityPubController, ObjectView}
+ alias Pleroma.Web.OStatus.{ActivityRepresenter, FeedRepresenter}
+ alias Pleroma.Web.{Federator, OStatus}
alias Pleroma.Web.XML
- alias Pleroma.Web.ActivityPub.ObjectView
- alias Pleroma.Web.ActivityPub.ActivityPubController
- alias Pleroma.Web.ActivityPub.ActivityPub
plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming])
@httpoison Application.get_env(:pleroma, :httpoison)
use Bitwise
- alias Pleroma.Instances
+
+ alias Pleroma.{Instances, User}
alias Pleroma.Web.XML
alias Pleroma.Web.OStatus.ActivityRepresenter
- alias Pleroma.User
+
require Logger
def decode(salmon) do
defmodule Pleroma.Web.TwitterAPI.UtilController do
use Pleroma.Web, :controller
+
require Logger
- alias Pleroma.Web
- alias Pleroma.Web.OStatus
- alias Pleroma.Web.WebFinger
- alias Pleroma.Web.CommonAPI
+
alias Comeonin.Pbkdf2
+ alias Pleroma.{Emoji, PasswordResetToken, User, Repo}
+ alias Pleroma.Web
+ alias Pleroma.Web.{CommonAPI, OStatus, WebFinger}
alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.{Repo, PasswordResetToken, User, Emoji}
def show_password_reset(conn, %{"token" => token}) do
with %{used: false} = token <- Repo.get_by(PasswordResetToken, %{token: token}),
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
- alias Pleroma.{Activity, User}
- alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView}
+ alias Pleroma.{Activity, Formatter, HTML, User}
+ alias Pleroma.Web.TwitterAPI.{ActivityView, TwitterAPI, UserView}
alias Pleroma.Web.CommonAPI.Utils
- alias Pleroma.Formatter
- alias Pleroma.HTML
alias Pleroma.Web.MastodonAPI.StatusView
defp user_by_ap_id(user_list, ap_id) do
import Pleroma.Web.ControllerHelper, only: [json_response: 3]
- alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView, NotificationView}
- alias Pleroma.Web.CommonAPI
- alias Pleroma.{Repo, Activity, Object, User, Notification}
- alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.ActivityPub.Utils
alias Ecto.Changeset
+ alias Pleroma.Web.ActivityPub.{ActivityPub, Utils}
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.TwitterAPI.{ActivityView, NotificationView, TwitterAPI, UserView}
+ alias Pleroma.{Activity, Object, Notification, Repo, User}
require Logger
defmodule Pleroma.Web.TwitterAPI.ActivityView do
use Pleroma.Web, :view
+ alias Pleroma.{Activity, Formatter, HTML, Object, Repo, User}
alias Pleroma.Web.CommonAPI.Utils
- alias Pleroma.User
- alias Pleroma.Web.TwitterAPI.UserView
- alias Pleroma.Web.TwitterAPI.ActivityView
- alias Pleroma.Web.TwitterAPI.TwitterAPI
- alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
alias Pleroma.Web.MastodonAPI.StatusView
- alias Pleroma.Activity
- alias Pleroma.HTML
- alias Pleroma.Object
- alias Pleroma.User
- alias Pleroma.Repo
- alias Pleroma.Formatter
+ alias Pleroma.Web.TwitterAPI.{ActivityView, TwitterAPI, UserView}
+ alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
import Ecto.Query
require Logger
use Pleroma.Web, :view
alias Pleroma.{Notification, User}
alias Pleroma.Web.CommonAPI.Utils
- alias Pleroma.Web.TwitterAPI.UserView
- alias Pleroma.Web.TwitterAPI.ActivityView
+ alias Pleroma.Web.TwitterAPI.{ActivityView, UserView}
defp get_user(ap_id, opts) do
cond do
defmodule Pleroma.Web.TwitterAPI.UserView do
use Pleroma.Web, :view
- alias Pleroma.User
- alias Pleroma.Formatter
+ alias Pleroma.{Formatter, HTML, User}
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MediaProxy
- alias Pleroma.HTML
def render("show.json", %{user: user = %User{}} = assigns) do
render_one(user, Pleroma.Web.TwitterAPI.UserView, "user.json", assigns)
defmodule Pleroma.Web.Websub do
alias Ecto.Changeset
- alias Pleroma.Repo
- alias Pleroma.Instances
+ alias Pleroma.{Instances, Repo}
alias Pleroma.Web.Websub.{WebsubServerSubscription, WebsubClientSubscription}
alias Pleroma.Web.OStatus.FeedRepresenter
alias Pleroma.Web.{XML, Endpoint, OStatus}