# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FollowingRelationship do
defp after_update(state, %User{} = follower, %User{} = following) do
with {:ok, following} <- User.update_follower_count(following),
{:ok, follower} <- User.update_following_count(follower) do
- Pleroma.Web.Streamer.stream("relationships:update", %{
+ Pleroma.Web.Streamer.stream("follow_relationship", %{
state: state,
following: following,
follower: follower
|> join(:inner, [r], f in assoc(r, :follower))
|> where([r], r.state == ^:follow_pending)
|> where([r], r.following_id == ^id)
- |> where([r, f], f.deactivated != true)
+ |> where([r, f], f.is_active == true)
|> select([r, f], f)
|> Repo.all()
end