forked from AkkomaGang/akkoma
mastodon api: relationship view: better handle no pre-existing follow activity
This commit is contained in:
parent
e69faf550c
commit
7f530f6f80
1 changed files with 7 additions and 1 deletions
|
@ -73,7 +73,13 @@ def render("mention.json", %{user: user}) do
|
||||||
|
|
||||||
def render("relationship.json", %{user: user, target: target}) do
|
def render("relationship.json", %{user: user, target: target}) do
|
||||||
follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target)
|
follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target)
|
||||||
requested = follow_activity.data["state"] == "pending"
|
|
||||||
|
requested =
|
||||||
|
if follow_activity do
|
||||||
|
follow_activity.data["state"] == "pending"
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
%{
|
%{
|
||||||
id: to_string(target.id),
|
id: to_string(target.id),
|
||||||
|
|
Loading…
Reference in a new issue