diff options
author | lain <lain@soykaf.club> | 2020-05-07 14:45:20 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-07 14:45:20 +0200 |
commit | f0c22df2265e922a66ca69c3508fe812b8e20b6b (patch) | |
tree | be510abc9cc9154e07b2ec9eaf344e6e4e88bed1 /lib/pleroma/web/common_api | |
parent | 92caae592338a3ca307686e7644f2de18bb57ce5 (diff) | |
parent | 4c92dfb73ef1f40438adf5da009499205a677912 (diff) | |
download | pleroma-f0c22df2265e922a66ca69c3508fe812b8e20b6b.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/undo-validator-reduced
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 2a1eb7f37..1e6bbbab7 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -87,8 +87,8 @@ defmodule Pleroma.Web.CommonAPI do {:find_activity, Activity.get_by_id_with_object(activity_id)}, %Object{} = object <- Object.normalize(activity), true <- User.superuser?(user) || user.ap_id == object.data["actor"], - {:ok, _} <- unpin(activity_id, user), - {:ok, delete} <- ActivityPub.delete(object) do + {:ok, delete_data, _} <- Builder.delete(user, object.data["id"]), + {:ok, delete, _} <- Pipeline.common_pipeline(delete_data, local: true) do {:ok, delete} else {:find_activity, _} -> {:error, :not_found} diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 6540fa5d1..793f2e7f8 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -402,6 +402,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do end end + @spec confirm_current_password(User.t(), String.t()) :: {:ok, User.t()} | {:error, String.t()} def confirm_current_password(user, password) do with %User{local: true} = db_user <- User.get_cached_by_id(user.id), true <- AuthenticationPlug.checkpw(password, db_user.password_hash) do |