Replace user.following with Pleroma.FollowingRelationship
This commit is contained in:
parent
2c7ff32e5b
commit
059005ff82
28 changed files with 275 additions and 235 deletions
|
|
@ -52,9 +52,9 @@ defmodule Mix.Tasks.Pleroma.Database do
|
|||
def run(["update_users_following_followers_counts"]) do
|
||||
start_pleroma()
|
||||
|
||||
users = Repo.all(User)
|
||||
Enum.each(users, &User.remove_duplicated_following/1)
|
||||
Enum.each(users, &User.update_follower_count/1)
|
||||
User
|
||||
|> Repo.all()
|
||||
|> Enum.each(&User.update_follower_count/1)
|
||||
end
|
||||
|
||||
def run(["prune_objects" | args]) do
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ defmodule Mix.Tasks.Pleroma.Relay do
|
|||
def run(["list"]) do
|
||||
start_pleroma()
|
||||
|
||||
with %User{following: following} = _user <- Relay.get_actor() do
|
||||
following
|
||||
with %User{} = user <- Relay.get_actor() do
|
||||
user
|
||||
|> User.following()
|
||||
|> Enum.map(fn entry -> URI.parse(entry).host end)
|
||||
|> Enum.uniq()
|
||||
|> Enum.each(&shell_info(&1))
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ defmodule Mix.Tasks.Pleroma.User do
|
|||
|
||||
user = User.get_cached_by_id(user.id)
|
||||
|
||||
if Enum.empty?(user.following) do
|
||||
if Enum.empty?(User.get_friends(user)) do
|
||||
shell_info("Successfully unsubscribed all followers from #{user.nickname}")
|
||||
end
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue