mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 15:05:45 +00:00
Merge branch 'validate-user-info' of git.pleroma.social:pleroma/pleroma into validate-user-info
This commit is contained in:
commit
0bea0308f1
|
@ -20,7 +20,7 @@ defmodule Pleroma.Plugs.OAuthPlug do
|
|||
with token when not is_nil(token) <- token,
|
||||
%Token{user_id: user_id} <- Repo.get_by(Token, token: token),
|
||||
%User{} = user <- Repo.get(User, user_id),
|
||||
false <- !!user.info["deactivated"] do
|
||||
false <- !!user.info.deactivated do
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
else
|
||||
|
|
|
@ -284,7 +284,7 @@ defmodule Pleroma.User do
|
|||
end
|
||||
|
||||
def locked?(%User{} = user) do
|
||||
user.info["locked"] || false
|
||||
user.info.locked || false
|
||||
end
|
||||
|
||||
def get_by_ap_id(ap_id) do
|
||||
|
|
|
@ -173,7 +173,7 @@ defmodule Pleroma.Web.Streamer do
|
|||
Enum.each(topics[topic] || [], fn socket ->
|
||||
# Get the current user so we have up-to-date blocks etc.
|
||||
user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id)
|
||||
blocks = user.info["blocks"] || []
|
||||
blocks = user.info.blocks || []
|
||||
|
||||
parent = Object.normalize(item.data["object"])
|
||||
|
||||
|
@ -187,7 +187,7 @@ defmodule Pleroma.Web.Streamer do
|
|||
Enum.each(topics[topic] || [], fn socket ->
|
||||
# Get the current user so we have up-to-date blocks etc.
|
||||
user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id)
|
||||
blocks = user.info["blocks"] || []
|
||||
blocks = user.info.blocks || []
|
||||
|
||||
unless item.actor in blocks do
|
||||
send(socket.transport_pid, {:text, represent_update(item, user)})
|
||||
|
|
|
@ -17,7 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
|
||||
user =
|
||||
insert(:user, %{
|
||||
info: %{"note_count" => 5, "follower_count" => 3, "source_data" => source_data},
|
||||
info: %{note_count: 5, follower_count: 3, source_data: source_data},
|
||||
nickname: "shp@shitposter.club",
|
||||
name: ":karjalanpiirakka: shp",
|
||||
bio: "<script src=\"invalid-html\"></script><span>valid html</span>",
|
||||
|
@ -63,7 +63,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
test "Represent a Service(bot) account" do
|
||||
user =
|
||||
insert(:user, %{
|
||||
info: %{"note_count" => 5, "follower_count" => 3, "source_data" => %{"type" => "Service"}},
|
||||
info: %{note_count: 5, follower_count: 3, source_data: %{"type" => "Service"}},
|
||||
nickname: "shp@shitposter.club",
|
||||
inserted_at: ~N[2017-08-15 15:47:06.597036]
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue