Chat with remote users does not work if restrict_unauthenticated/profiles/remote is true
Environment
- Installation type (OTP or From Source): Source
- Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 2.0.50-2084-gf0d13fc3-develop
- Elixir version (
elixir -v
for from source installations, N/A for OTP): Elixir 1.10.4 - Operating system: Linux, Ubuntu 20.04
- PostgreSQL version (
psql -V
): psql (PostgreSQL) 12.3 (Ubuntu 12.3-1.pgdg20.04+1)
Bug description
In my prod.secret.exs
I have
config :pleroma, :restrict_unauthenticated,
timelines: %{local: false, federated: true},
profiles: %{local: false, remote: true},
activities: %{local: false, remote: true}
Setting :remote
to true for :profiles
is supposed to prevent unauthenticated visitors from viewing profiles of remote users, which is what I want. However, it also affects chat messages with remote users in an unintended way: /api/v1/pleroma/chats
returns {"account": {}, ...}
for remote chats, and {"account": {... a large dictionary ...}, ...}
for local ones. This causes the frontend to not render the remote chat messages properly after the first message exchange.
This is either due to the User.visible_for
code or the render function for “show.json” in MastodonAPI.AccountView
.