giant massive dep upgrade and dialyxir-found error emporium #371
6 changed files with 25 additions and 13 deletions
fix more typespecs
commit
bd6f1d6249
|
|
@ -14,7 +14,7 @@ defmodule Pleroma.Migrators.Support.BaseMigrator do
|
|||
@callback fault_rate_allowance() :: integer() | float()
|
||||
|
||||
defmacro __using__(_opts) do
|
||||
quote do
|
||||
quote generated: true do
|
||||
use GenServer
|
||||
|
||||
require Logger
|
||||
|
|
|
|||
|
|
@ -717,6 +717,7 @@ defmodule Pleroma.User do
|
|||
|> put_private_key()
|
||||
end
|
||||
|
||||
@spec register_changeset(User.t(), map(), keyword()) :: Changeset.t()
|
||||
def register_changeset(struct, params \\ %{}, opts \\ []) do
|
||||
bio_limit = Config.get([:instance, :user_bio_length], 5000)
|
||||
name_limit = Config.get([:instance, :user_name_length], 100)
|
||||
|
|
@ -1085,6 +1086,11 @@ defmodule Pleroma.User do
|
|||
get_cached_by_nickname(nickname)
|
||||
end
|
||||
|
||||
@spec set_cache(
|
||||
{:error, any}
|
||||
| {:ok, User.t()}
|
||||
| User.t()
|
||||
) :: {:ok, User.t()} | {:error, any}
|
||||
def set_cache({:ok, user}), do: set_cache(user)
|
||||
def set_cache({:error, err}), do: {:error, err}
|
||||
|
||||
|
|
@ -1095,12 +1101,14 @@ defmodule Pleroma.User do
|
|||
{:ok, user}
|
||||
end
|
||||
|
||||
@spec update_and_set_cache(User.t(), map()) :: {:ok, User.t()} | {:error, any}
|
||||
def update_and_set_cache(struct, params) do
|
||||
struct
|
||||
|> update_changeset(params)
|
||||
|> update_and_set_cache()
|
||||
end
|
||||
|
||||
@spec update_and_set_cache(Changeset.t()) :: {:ok, User.t()} | {:error, any}
|
||||
def update_and_set_cache(%{data: %Pleroma.User{} = user} = changeset) do
|
||||
was_superuser_before_update = User.superuser?(user)
|
||||
|
||||
|
|
@ -1155,6 +1163,7 @@ defmodule Pleroma.User do
|
|||
end
|
||||
end
|
||||
|
||||
@spec get_cached_by_id(String.t()) :: nil | Pleroma.User.t()
|
||||
def get_cached_by_id(id) do
|
||||
key = "id:#{id}"
|
||||
|
||||
|
|
@ -2315,6 +2324,7 @@ defmodule Pleroma.User do
|
|||
end
|
||||
end
|
||||
|
||||
@spec delete_alias(User.t(), User.t()) :: {:error, :no_such_alias}
|
||||
def delete_alias(user, alias_user) do
|
||||
current_aliases = user.also_known_as || []
|
||||
alias_ap_id = alias_user.ap_id
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
|
|||
def get_registration(%Plug.Conn{} = _conn), do: {:error, :missing_credentials}
|
||||
|
||||
@doc "Creates Pleroma.User record basing on params and Pleroma.Registration record."
|
||||
@spec create_from_registration(Plug.Conn.t(), Registration.t()) ::
|
||||
{:ok, User.t()} | {:error, any()}
|
||||
def create_from_registration(
|
||||
%Plug.Conn{params: %{"authorization" => registration_attrs}},
|
||||
%Registration{} = registration
|
||||
|
|
@ -89,6 +91,8 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
|
|||
{:ok, _} <-
|
||||
Registration.changeset(registration, %{user_id: new_user.id}) |> Repo.update() do
|
||||
{:ok, new_user}
|
||||
else
|
||||
err -> {:error, err}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,10 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
end
|
||||
end
|
||||
|
||||
def remote_interaction(%{body_params: %{ap_id: ap_id, profile: profile}} = conn, _params) do
|
||||
def remote_interaction(
|
||||
%Plug.Conn{body_params: %{ap_id: ap_id, profile: profile}} = conn,
|
||||
_params
|
||||
) do
|
||||
with {:ok, %{"subscribe_address" => template}} <- WebFinger.finger(profile) do
|
||||
conn
|
||||
|> json(%{url: String.replace(template, "{uri}", ap_id)})
|
||||
|
|
|
|||
13
mix.exs
13
mix.exs
|
|
@ -113,7 +113,7 @@ defmodule Pleroma.Mixfile do
|
|||
# Type `mix help deps` for examples and options.
|
||||
defp deps do
|
||||
[
|
||||
{:phoenix, "~> 1.6.11"},
|
||||
{:phoenix, "~> 1.6.15"},
|
||||
{:tzdata, "~> 1.1.1"},
|
||||
{:plug_cowboy, "~> 2.6"},
|
||||
{:phoenix_pubsub, "~> 2.1"},
|
||||
|
|
@ -122,15 +122,12 @@ defmodule Pleroma.Mixfile do
|
|||
{:ecto_sql, "~> 3.9.0"},
|
||||
{:postgrex, ">= 0.16.3"},
|
||||
{:oban, "~> 2.12.1"},
|
||||
{:gettext,
|
||||
git: "https://github.com/tusooa/gettext.git",
|
||||
ref: "72fb2496b6c5280ed911bdc3756890e7f38a4808",
|
||||
override: true},
|
||||
{:gettext, "~> 0.20.0"},
|
||||
{:bcrypt_elixir, "~> 2.2"},
|
||||
{:trailing_format_plug, "~> 0.0.7"},
|
||||
{:fast_sanitize, "~> 0.2.3"},
|
||||
{:html_entities, "~> 0.5"},
|
||||
{:phoenix_html, "~> 3.1"},
|
||||
{:phoenix_html, "~> 3.2"},
|
||||
{:calendar, "~> 1.0"},
|
||||
{:cachex, "~> 3.4"},
|
||||
{:tesla, "~> 1.4.4"},
|
||||
|
|
@ -171,9 +168,7 @@ defmodule Pleroma.Mixfile do
|
|||
{:plug_static_index_html, "~> 1.0.0"},
|
||||
{:flake_id, "~> 0.1.0"},
|
||||
{:concurrent_limiter, "~> 0.1.1"},
|
||||
{:remote_ip,
|
||||
git: "https://git.pleroma.social/pleroma/remote_ip.git",
|
||||
ref: "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8"},
|
||||
{:remote_ip, "~> 1.1.0"},
|
||||
{:captcha,
|
||||
git: "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git",
|
||||
ref: "e0f16822d578866e186a0974d65ad58cddc1e2ab"},
|
||||
|
|
|
|||
4
mix.lock
4
mix.lock
|
|
@ -49,7 +49,7 @@
|
|||
"flake_id": {:hex, :flake_id, "0.1.0", "7716b086d2e405d09b647121a166498a0d93d1a623bead243e1f74216079ccb3", [:mix], [{:base62, "~> 1.2", [hex: :base62, repo: "hexpm", optional: false]}, {:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "31fc8090fde1acd267c07c36ea7365b8604055f897d3a53dd967658c691bd827"},
|
||||
"floki": {:hex, :floki, "0.34.0", "002d0cc194b48794d74711731db004fafeb328fe676976f160685262d43706a8", [:mix], [], "hexpm", "9c3a9f43f40dde00332a589bd9d389b90c1f518aef500364d00636acc5ebc99c"},
|
||||
"gen_smtp": {:hex, :gen_smtp, "0.15.0", "9f51960c17769b26833b50df0b96123605a8024738b62db747fece14eb2fbfcc", [:rebar3], [], "hexpm", "29bd14a88030980849c7ed2447b8db6d6c9278a28b11a44cafe41b791205440f"},
|
||||
"gettext": {:git, "https://github.com/tusooa/gettext.git", "72fb2496b6c5280ed911bdc3756890e7f38a4808", [ref: "72fb2496b6c5280ed911bdc3756890e7f38a4808"]},
|
||||
"gettext": {:hex, :gettext, "0.20.0", "75ad71de05f2ef56991dbae224d35c68b098dd0e26918def5bb45591d5c8d429", [:mix], [], "hexpm", "1c03b177435e93a47441d7f681a7040bd2a816ece9e2666d1c9001035121eb3d"},
|
||||
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
|
||||
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
|
||||
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
"pot": {:hex, :pot, "1.0.2", "13abb849139fdc04ab8154986abbcb63bdee5de6ed2ba7e1713527e33df923dd", [:rebar3], [], "hexpm", "78fe127f5a4f5f919d6ea5a2a671827bd53eb9d37e5b4128c0ad3df99856c2e0"},
|
||||
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
|
||||
"recon": {:hex, :recon, "2.5.2", "cba53fa8db83ad968c9a652e09c3ed7ddcc4da434f27c3eaa9ca47ffb2b1ff03", [:mix, :rebar3], [], "hexpm", "2c7523c8dee91dff41f6b3d63cba2bd49eb6d2fe5bf1eec0df7f87eb5e230e1c"},
|
||||
"remote_ip": {:git, "https://git.pleroma.social/pleroma/remote_ip.git", "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8", [ref: "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8"]},
|
||||
"remote_ip": {:hex, :remote_ip, "1.1.0", "cb308841595d15df3f9073b7c39243a1dd6ca56e5020295cb012c76fbec50f2d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "616ffdf66aaad6a72fc546dabf42eed87e2a99e97b09cbd92b10cc180d02ed74"},
|
||||
"search_parser": {:git, "https://github.com/FloatingGhost/pleroma-contrib-search-parser.git", "08971a81e68686f9ac465cfb6661d51c5e4e1e7f", [ref: "08971a81e68686f9ac465cfb6661d51c5e4e1e7f"]},
|
||||
"sleeplocks": {:hex, :sleeplocks, "1.1.2", "d45aa1c5513da48c888715e3381211c859af34bee9b8290490e10c90bb6ff0ca", [:rebar3], [], "hexpm", "9fe5d048c5b781d6305c1a3a0f40bb3dfc06f49bf40571f3d2d0c57eaa7f59a5"},
|
||||
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue