mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-23 22:56:08 +09:00
dbg
This commit is contained in:
parent
d7aff92870
commit
55f0acf32f
@ -269,23 +269,37 @@ export async function createPerson(
|
|||||||
|
|
||||||
const isBot = getApType(object) === "Service";
|
const isBot = getApType(object) === "Service";
|
||||||
|
|
||||||
|
console.log('createPerson 6.1');
|
||||||
|
|
||||||
const bday = person["vcard:bday"]?.match(/^\d{4}-\d{2}-\d{2}/);
|
const bday = person["vcard:bday"]?.match(/^\d{4}-\d{2}-\d{2}/);
|
||||||
|
|
||||||
|
console.log('createPerson 6.2');
|
||||||
|
|
||||||
const url = getOneApHrefNullable(person.url);
|
const url = getOneApHrefNullable(person.url);
|
||||||
|
|
||||||
|
console.log('createPerson 6.3');
|
||||||
|
|
||||||
if (url && !url.startsWith("https://")) {
|
if (url && !url.startsWith("https://")) {
|
||||||
throw new Error(`unexpected schema of person url: ${url}`);
|
throw new Error(`unexpected schema of person url: ${url}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('createPerson 6.4');
|
||||||
|
|
||||||
let followersCount: number | undefined;
|
let followersCount: number | undefined;
|
||||||
|
|
||||||
|
console.log('createPerson 6.5');
|
||||||
|
|
||||||
if (typeof person.followers === "string") {
|
if (typeof person.followers === "string") {
|
||||||
try {
|
try {
|
||||||
|
console.log('createPerson 6.6');
|
||||||
let data = await fetch(person.followers, {
|
let data = await fetch(person.followers, {
|
||||||
headers: { Accept: "application/json" },
|
headers: { Accept: "application/json" },
|
||||||
});
|
});
|
||||||
|
console.log('createPerson 6.7');
|
||||||
let json_data = JSON.parse(await data.text());
|
let json_data = JSON.parse(await data.text());
|
||||||
|
|
||||||
|
console.log('createPerson 6.8');
|
||||||
|
|
||||||
followersCount = json_data.totalItems;
|
followersCount = json_data.totalItems;
|
||||||
} catch {
|
} catch {
|
||||||
followersCount = undefined;
|
followersCount = undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user