mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-12 20:25:00 +00:00
[#394] User view (Twitter & Mastadon API): wrapped "tags" in "pleroma" map.
This commit is contained in:
parent
abbf347dc7
commit
7a2162bbcb
4 changed files with 14 additions and 8 deletions
|
@ -59,8 +59,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
|
||||||
privacy: user_info.default_scope,
|
privacy: user_info.default_scope,
|
||||||
sensitive: false
|
sensitive: false
|
||||||
},
|
},
|
||||||
|
|
||||||
# Pleroma extension
|
# Pleroma extension
|
||||||
tags: user.tags
|
pleroma: %{
|
||||||
|
tags: user.tags
|
||||||
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -78,8 +78,11 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
||||||
"default_scope" => user.info.default_scope,
|
"default_scope" => user.info.default_scope,
|
||||||
"no_rich_text" => user.info.no_rich_text,
|
"no_rich_text" => user.info.no_rich_text,
|
||||||
"fields" => fields,
|
"fields" => fields,
|
||||||
|
|
||||||
# Pleroma extension
|
# Pleroma extension
|
||||||
"tags" => user.tags
|
"pleroma" => %{
|
||||||
|
"tags" => user.tags
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if assigns[:token] do
|
if assigns[:token] do
|
||||||
|
|
|
@ -55,7 +55,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
||||||
privacy: "public",
|
privacy: "public",
|
||||||
sensitive: false
|
sensitive: false
|
||||||
},
|
},
|
||||||
tags: []
|
pleroma: %{tags: []}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected == AccountView.render("account.json", %{user: user})
|
assert expected == AccountView.render("account.json", %{user: user})
|
||||||
|
@ -93,7 +93,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
||||||
privacy: "public",
|
privacy: "public",
|
||||||
sensitive: false
|
sensitive: false
|
||||||
},
|
},
|
||||||
tags: []
|
pleroma: %{tags: []}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected == AccountView.render("account.json", %{user: user})
|
assert expected == AccountView.render("account.json", %{user: user})
|
||||||
|
|
|
@ -97,7 +97,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"tags" => []
|
"pleroma" => %{"tags" => []}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: user})
|
assert represented == UserView.render("show.json", %{user: user})
|
||||||
|
@ -139,7 +139,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"tags" => []
|
"pleroma" => %{"tags" => []}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: user, for: follower})
|
assert represented == UserView.render("show.json", %{user: user, for: follower})
|
||||||
|
@ -182,7 +182,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"tags" => []
|
"pleroma" => %{"tags" => []}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: follower, for: user})
|
assert represented == UserView.render("show.json", %{user: follower, for: user})
|
||||||
|
@ -232,7 +232,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"tags" => []
|
"pleroma" => %{"tags" => []}
|
||||||
}
|
}
|
||||||
|
|
||||||
blocker = Repo.get(User, blocker.id)
|
blocker = Repo.get(User, blocker.id)
|
||||||
|
|
Loading…
Reference in a new issue