瀏覽代碼

mastodon api: relationship view: better handle no pre-existing follow activity

tags/v0.9.9
William Pitcock 5 年之前
父節點
當前提交
7f530f6f80
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      lib/pleroma/web/mastodon_api/views/account_view.ex

+ 7
- 1
lib/pleroma/web/mastodon_api/views/account_view.ex 查看文件

@@ -73,7 +73,13 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do

def render("relationship.json", %{user: user, target: target}) do
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),


Loading…
取消
儲存