mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
fix inverted condition in resolveLocal
This commit is contained in:
parent
cb8ae13685
commit
141a92cf0c
1 changed files with 2 additions and 1 deletions
|
@ -347,6 +347,7 @@ export class Resolver {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO try to remove this, as it creates a large attack surface
|
||||||
@bindThis
|
@bindThis
|
||||||
private resolveLocal(url: string): Promise<IObjectWithId> {
|
private resolveLocal(url: string): Promise<IObjectWithId> {
|
||||||
const parsed = this.apDbResolverService.parseUri(url);
|
const parsed = this.apDbResolverService.parseUri(url);
|
||||||
|
@ -376,7 +377,7 @@ export class Resolver {
|
||||||
.then(([note, poll]) => this.apRendererService.renderQuestion({ id: note.userId }, note, poll)) as Promise<IObjectWithId>;
|
.then(([note, poll]) => this.apRendererService.renderQuestion({ id: note.userId }, note, poll)) as Promise<IObjectWithId>;
|
||||||
case 'likes':
|
case 'likes':
|
||||||
return this.noteReactionsRepository.findOneOrFail({ where: { id: parsed.id }, relations: { user: true } }).then(async reaction => {
|
return this.noteReactionsRepository.findOneOrFail({ where: { id: parsed.id }, relations: { user: true } }).then(async reaction => {
|
||||||
if (reaction.user?.host == null) {
|
if (reaction.user?.host != null) {
|
||||||
throw new IdentifiableError('02b40cd0-fa92-4b0c-acc9-fb2ada952ab8', `failed to resolve local ${url}: not a local reaction`);
|
throw new IdentifiableError('02b40cd0-fa92-4b0c-acc9-fb2ada952ab8', `failed to resolve local ${url}: not a local reaction`);
|
||||||
}
|
}
|
||||||
return this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, { uri: null }));
|
return this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, { uri: null }));
|
||||||
|
|
Loading…
Add table
Reference in a new issue