summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-12 12:29:37 +0200
committerrinpatch <rinpatch@sdf.org>2020-05-12 23:05:57 +0300
commitec5e05780292710a3454b21d32a1af053cb603e0 (patch)
tree2d9f3e411380b81a1ea28fecfb25c202dda3da08 /lib
parentb5b675fa14094ae13b78b3de137a9c6de83b3696 (diff)
downloadpleroma-ec5e05780292710a3454b21d32a1af053cb603e0.tar.gz
pleroma-ec5e05780292710a3454b21d32a1af053cb603e0.zip
Transmogrifier: On incoming follow accept, update follow counts.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 831739c5f..3fc4762d6 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -544,6 +544,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
{:ok, follow_activity} <- Utils.update_follow_state_for_all(follow_activity, "accept"),
%User{local: true} = follower <- User.get_cached_by_ap_id(follow_activity.data["actor"]),
{:ok, _relationship} <- FollowingRelationship.update(follower, followed, :follow_accept) do
+ User.update_follower_count(followed)
+ User.update_following_count(follower)
+
ActivityPub.accept(%{
to: follow_activity.data["to"],
type: "Accept",
@@ -553,7 +556,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
activity_id: id
})
else
- _e -> :error
+ _e ->
+ :error
end
end