projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
naming
[akkoma]
/
lib
/
pleroma
/
following_relationship.ex
diff --git
a/lib/pleroma/following_relationship.ex
b/lib/pleroma/following_relationship.ex
index a03c9bd304c595bb6e16832866001328c4951a2f..a6d28115137b32cb5ec30026f87461c20971930b 100644
(file)
--- a/
lib/pleroma/following_relationship.ex
+++ b/
lib/pleroma/following_relationship.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FollowingRelationship do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FollowingRelationship do
@@
-58,8
+58,8
@@
defmodule Pleroma.FollowingRelationship do
def unfollow(%User{} = follower, %User{} = following) do
case get(follower, following) do
def unfollow(%User{} = follower, %User{} = following) do
case get(follower, following) do
- nil -> {:ok, nil}
%__MODULE__{} = following_relationship -> Repo.delete(following_relationship)
%__MODULE__{} = following_relationship -> Repo.delete(following_relationship)
+ _ -> {:ok, nil}
end
end
end
end
@@
-121,8
+121,12
@@
defmodule Pleroma.FollowingRelationship do
Pleroma.Web.CommonAPI.follow(following_relationship.follower, target)
end)
|> case do
Pleroma.Web.CommonAPI.follow(following_relationship.follower, target)
end)
|> case do
- [] -> :ok
- _ -> move_following(origin, target)
+ [] ->
+ User.update_follower_count(origin)
+ :ok
+
+ _ ->
+ move_following(origin, target)
end
end
end
end
end
end