mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
wip
This commit is contained in:
parent
e20e321a82
commit
00dd472ebe
@ -15,7 +15,7 @@ export default async (value, verifier?: string) => {
|
|||||||
object.type !== 'Person' ||
|
object.type !== 'Person' ||
|
||||||
typeof object.preferredUsername !== 'string' ||
|
typeof object.preferredUsername !== 'string' ||
|
||||||
!validateUsername(object.preferredUsername) ||
|
!validateUsername(object.preferredUsername) ||
|
||||||
!isValidName(object.name) ||
|
(object.name != '' && !isValidName(object.name)) ||
|
||||||
!isValidDescription(object.summary)
|
!isValidDescription(object.summary)
|
||||||
) {
|
) {
|
||||||
throw new Error('invalid person');
|
throw new Error('invalid person');
|
||||||
|
@ -16,7 +16,7 @@ export default async (username, host, option) => {
|
|||||||
const finger = await webFinger(acctLower, acctLower);
|
const finger = await webFinger(acctLower, acctLower);
|
||||||
const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self');
|
const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self');
|
||||||
if (!self) {
|
if (!self) {
|
||||||
throw new Error();
|
throw new Error('self link not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
user = await resolvePerson(self.href, acctLower);
|
user = await resolvePerson(self.href, acctLower);
|
||||||
|
@ -37,7 +37,8 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
|
|||||||
if (typeof host === 'string') {
|
if (typeof host === 'string') {
|
||||||
try {
|
try {
|
||||||
user = await resolveRemoteUser(username, host, cursorOption);
|
user = await resolveRemoteUser(username, host, cursorOption);
|
||||||
} catch (exception) {
|
} catch (e) {
|
||||||
|
console.warn(`failed to resolve remote user: ${e}`);
|
||||||
return rej('failed to resolve remote user');
|
return rej('failed to resolve remote user');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user