[#1335] User: refactored :blocks field into :blocked_users relation.

Introduced UserBlock.
This commit is contained in:
Ivan Tashkinov 2019-11-10 16:30:21 +03:00
commit 3db988250b
20 changed files with 234 additions and 69 deletions

View file

@ -883,7 +883,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
user = insert(:user)
other_user = insert(:user)
{:ok, user} = User.block(user, other_user)
{:ok, _user_block} = User.block(user, other_user)
conn =
conn

View file

@ -1108,7 +1108,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
activity: activity
} do
other_user = insert(:user)
{:ok, user} = User.block(user, other_user)
{:ok, _user_block} = User.block(user, other_user)
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
@ -1205,7 +1205,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
activity: activity
} do
other_user = insert(:user)
{:ok, user} = User.block(user, other_user)
{:ok, _user_block} = User.block(user, other_user)
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)

View file

@ -194,7 +194,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
blocker = insert(:user)
blocked = insert(:user)
user = insert(:user)
{:ok, blocker} = User.block(blocker, blocked)
{:ok, _user_block} = User.block(blocker, blocked)
{:ok, _blocked_direct} =
CommonAPI.post(blocked, %{