aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-03-28 18:49:03 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-03-28 18:49:03 +0300
commitbe9d18461a5ed6bd835e2eba8d3b54ba61fc51fb (patch)
tree0b5b199feab5cef526d365030213170c99fb9f0f /lib/pleroma/web/mastodon_api
parent4e81b4b190161ebb0c496c682fa8e1e0c38a3903 (diff)
downloadpleroma-be9d18461a5ed6bd835e2eba8d3b54ba61fc51fb.tar.gz
FollowingRelationship storage & performance optimizations (state turned `ecto_enum`-driven integer, reorganized indices etc.).
Diffstat (limited to 'lib/pleroma/web/mastodon_api')
-rw-r--r--lib/pleroma/web/mastodon_api/views/account_view.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex
index 0efcabc01..f2dc2a9bd 100644
--- a/lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -71,7 +71,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
followed_by =
if following_relationships do
case FollowingRelationship.find(following_relationships, target, reading_user) do
- %{state: "accept"} -> true
+ %{state: :follow_accept} -> true
_ -> false
end
else
@@ -81,7 +81,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
# NOTE: adjust UserRelationship.view_relationships_option/2 on new relation-related flags
%{
id: to_string(target.id),
- following: follow_state == "accept",
+ following: follow_state == :follow_accept,
followed_by: followed_by,
blocking:
UserRelationship.exists?(
@@ -123,7 +123,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
reading_user,
&User.subscribed_to?(&2, &1)
),
- requested: follow_state == "pending",
+ requested: follow_state == :follow_pending,
domain_blocking: User.blocks_domain?(reading_user, target),
showing_reblogs:
not UserRelationship.exists?(