Fix order of args for hide_reblogs/2
This commit is contained in:
parent
adb93f7e5d
commit
3f4f567c9c
6 changed files with 10 additions and 10 deletions
|
@ -687,7 +687,7 @@ defp set_visibility(activity, %{visibility: visibility}) do
|
|||
defp set_visibility(activity, _), do: {:ok, activity}
|
||||
|
||||
@spec hide_reblogs(User.t(), User.t()) :: {:ok, any()} | {:error, any()}
|
||||
def hide_reblogs(%User{} = user, %User{} = target) do
|
||||
def hide_reblogs(%User{} = target, %User{} = user) do
|
||||
UserRelationship.create_reblog_mute(user, target)
|
||||
end
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ def follow(follower, followed, params \\ %{}) do
|
|||
end
|
||||
|
||||
defp set_reblogs_visibility(false, {:ok, follower, followed, _}) do
|
||||
CommonAPI.hide_reblogs(follower, followed)
|
||||
CommonAPI.hide_reblogs(followed, follower)
|
||||
end
|
||||
|
||||
defp set_reblogs_visibility(_, {:ok, follower, followed, _}) do
|
||||
|
|
|
@ -1358,7 +1358,7 @@ test "doesn't return reblogs for users for whom reblogs have been muted" do
|
|||
activity = insert(:note_activity)
|
||||
user = insert(:user)
|
||||
booster = insert(:user)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(user, booster)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(booster, user)
|
||||
|
||||
{:ok, activity} = CommonAPI.repeat(activity.id, booster)
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ test "returns reblogs for users for whom reblogs have not been muted" do
|
|||
activity = insert(:note_activity)
|
||||
user = insert(:user)
|
||||
booster = insert(:user)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(user, booster)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(booster, user)
|
||||
{:ok, _reblog_mute} = CommonAPI.show_reblogs(user, booster)
|
||||
|
||||
{:ok, activity} = CommonAPI.repeat(activity.id, booster)
|
||||
|
|
|
@ -1404,13 +1404,13 @@ test "creates a report with provided rules" do
|
|||
end
|
||||
|
||||
test "add a reblog mute", %{muter: muter, muted: muted} do
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(muter, muted)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(muted, muter)
|
||||
|
||||
assert User.showing_reblogs?(muter, muted) == false
|
||||
end
|
||||
|
||||
test "remove a reblog mute", %{muter: muter, muted: muted} do
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(muter, muted)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(muted, muter)
|
||||
{:ok, _reblog_mute} = CommonAPI.show_reblogs(muter, muted)
|
||||
|
||||
assert User.showing_reblogs?(muter, muted) == true
|
||||
|
|
|
@ -436,7 +436,7 @@ test "represent a relationship for the following and followed user" do
|
|||
{:ok, other_user, user} = User.follow(other_user, user)
|
||||
{:ok, _subscription} = User.subscribe(user, other_user)
|
||||
{:ok, _user_relationships} = User.mute(user, other_user, %{notifications: true})
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(user, other_user)
|
||||
{:ok, _reblog_mute} = CommonAPI.hide_reblogs(other_user, user)
|
||||
|
||||
expected =
|
||||
Map.merge(
|
||||
|
|
|
@ -827,7 +827,7 @@ test "it filters muted reblogs", %{user: user1, token: user1_token} do
|
|||
user2 = insert(:user)
|
||||
user3 = insert(:user)
|
||||
CommonAPI.follow(user2, user1)
|
||||
CommonAPI.hide_reblogs(user1, user2)
|
||||
CommonAPI.hide_reblogs(user2, user1)
|
||||
|
||||
{:ok, create_activity} = CommonAPI.post(user3, %{status: "I'm kawen"})
|
||||
|
||||
|
@ -843,7 +843,7 @@ test "it filters reblog notification for reblog-muted actors", %{
|
|||
} do
|
||||
user2 = insert(:user)
|
||||
CommonAPI.follow(user2, user1)
|
||||
CommonAPI.hide_reblogs(user1, user2)
|
||||
CommonAPI.hide_reblogs(user2, user1)
|
||||
|
||||
{:ok, create_activity} = CommonAPI.post(user1, %{status: "I'm kawen"})
|
||||
Streamer.get_topic_and_add_socket("user", user1, user1_token)
|
||||
|
@ -859,7 +859,7 @@ test "it send non-reblog notification for reblog-muted actors", %{
|
|||
} do
|
||||
user2 = insert(:user)
|
||||
CommonAPI.follow(user2, user1)
|
||||
CommonAPI.hide_reblogs(user1, user2)
|
||||
CommonAPI.hide_reblogs(user2, user1)
|
||||
|
||||
{:ok, create_activity} = CommonAPI.post(user1, %{status: "I'm kawen"})
|
||||
Streamer.get_topic_and_add_socket("user", user1, user1_token)
|
||||
|
|
Loading…
Reference in a new issue