Add `also_known_as` field to Pleroma.User
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 7fc5051ea6307f308d053b4e2ac61a725614ae06..dc962673c2c80ae2bc7a7e0c2769a2ebe7fcb56d 100644 (file)
@@ -1117,7 +1117,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       name: data["name"],
       follower_address: data["followers"],
       following_address: data["following"],
-      bio: data["summary"]
+      bio: data["summary"],
+      also_known_as: Map.get(data, "alsoKnownAs", [])
     }
 
     # nickname can be nil because of virtual actors
@@ -1164,7 +1165,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     with {:enabled, true} <-
            {:enabled, Pleroma.Config.get([:instance, :external_user_synchronization])},
          {:ok, info} <- fetch_follow_information_for_user(data) do
-      info = Map.merge(data.info, info)
+      info = Map.merge(data[:info] || %{}, info)
       Map.put(data, :info, info)
     else
       {:enabled, false} ->