Fix logic.
authorRoger Braun <rbraun@Bobble.local>
Wed, 13 Sep 2017 14:05:39 +0000 (16:05 +0200)
committerRoger Braun <rbraun@Bobble.local>
Wed, 13 Sep 2017 14:05:39 +0000 (16:05 +0200)
lib/pleroma/web/mastodon_api/views/account_view.ex
test/web/mastodon_api/account_view_test.exs

index 4e9ee413207e662e2ec7e0d05f5ff539cf6c16e1..4f65eb772db39d1b7fbbddf2a606af76bc1cbdce 100644 (file)
@@ -43,8 +43,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
   def render("relationship.json", %{user: user, target: target}) do
     %{
       id: target.id,
-      following: User.following?(target, user),
-      followed_by: User.following?(user, target),
+      following: User.following?(user, target),
+      followed_by: User.following?(target, user),
       blocking: false,
       muting: false,
       requested: false,
index 259258281c8bb731ab9a5c27c9845e9278840698..c8f33f98c24efd549e81e7c0813da80dea963542 100644 (file)
@@ -49,8 +49,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
 
     expected = %{
       id: other_user.id,
-      following: false,
-      followed_by: true,
+      following: true,
+      followed_by: false,
       blocking: false,
       muting: false,
       requested: false,