%{
following_count: length(user.following) - oneself,
note_count: user.info["note_count"] || 0,
- follower_count: user.info["follower_count"] || 0
+ follower_count: user.info["follower_count"] || 0,
+ locked: user.info["locked"] || false
}
end
"url" => [%{"href" => data["image"]["url"]}]
}
+ locked = data["manuallyApprovesFollowers"] || false
data = Transmogrifier.maybe_fix_user_object(data)
user_data = %{
info: %{
"ap_enabled" => true,
"source_data" => data,
- "banner" => banner
+ "banner" => banner,
+ "locked" => locked
},
avatar: avatar,
nickname: "#{data["preferredUsername"]}@#{URI.parse(data["id"]).host}",
"name" => user.name,
"summary" => user.bio,
"url" => user.ap_id,
- "manuallyApprovesFollowers" => false,
+ "manuallyApprovesFollowers" => user.info["locked"] || false,
"publicKey" => %{
"id" => "#{user.ap_id}#main-key",
"owner" => user.ap_id,
username: hd(String.split(user.nickname, "@")),
acct: user.nickname,
display_name: user.name || user.nickname,
- locked: false,
+ locked: user_info.locked,
created_at: Utils.to_masto_date(user.inserted_at),
followers_count: user_info.follower_count,
following_count: user_info.following_count,