aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user.ex
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2021-06-17 18:43:46 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2021-07-21 09:19:28 +0200
commitbd977a3c3f4ede45c8f911cf26fd81561ecd8b7f (patch)
treee35b82ae641b922cdd8a94e8f355a6f5d969cc4b /lib/pleroma/user.ex
parent173e977e283789a814278c63bc81f40a13942e21 (diff)
downloadpleroma-features/ingestion-unfollow.tar.gz
Ingestion Pipeline: Undo-Follow aka Unfollowfeatures/ingestion-unfollow
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r--lib/pleroma/user.ex12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 62506f37a..5c0efb38d 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -983,7 +983,7 @@ defmodule Pleroma.User do
end
def unfollow(%User{ap_id: ap_id}, %User{ap_id: ap_id}) do
- {:error, "Not subscribed!"}
+ {:error, "Can't unfollow yourself!"}
end
@spec unfollow(User.t(), User.t()) :: {:ok, User.t(), Activity.t()} | {:error, String.t()}
@@ -1771,17 +1771,11 @@ defmodule Pleroma.User do
# Remove all relationships
user
|> get_followers()
- |> Enum.each(fn follower ->
- ActivityPub.unfollow(follower, user)
- unfollow(follower, user)
- end)
+ |> Enum.each(fn follower -> ActivityPub.unfollow(follower, user) end)
user
|> get_friends()
- |> Enum.each(fn followed ->
- ActivityPub.unfollow(user, followed)
- unfollow(user, followed)
- end)
+ |> Enum.each(fn followed -> ActivityPub.unfollow(user, followed) end)
delete_user_activities(user)
delete_notifications_from_user_activities(user)