Use actor_types() to determine whether the Update is for user

This commit is contained in:
Tusooa Zhu 2022-08-02 10:15:56 -04:00
commit a4fa286d20
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
2 changed files with 7 additions and 3 deletions

View file

@ -163,8 +163,9 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
updated_object_id = updated_object["id"]
with {_, true} <- {:has_id, is_binary(updated_object_id)},
{_, user} <- {:user, Pleroma.User.get_by_ap_id(updated_object_id)} do
if user do
%{"type" => type} <- updated_object,
{_, is_user} <- {:is_user, type in Pleroma.Constants.actor_types()} do
if is_user do
handle_update_user(object, meta)
else
handle_update_object(object, meta)