mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
fix(federation): 🐛 Fix remote emojis being incorrectly marked as local
This commit is contained in:
parent
c94dd7c59d
commit
cbbf49905b
4 changed files with 40 additions and 24 deletions
|
|
@ -16,7 +16,7 @@ import type {
|
|||
User as VersiaUser,
|
||||
} from "@versia/federation/types";
|
||||
import {
|
||||
type Instance,
|
||||
Instance,
|
||||
Like,
|
||||
Note,
|
||||
Notification,
|
||||
|
|
@ -277,6 +277,14 @@ export class InboxProcessor {
|
|||
private async processNote(): Promise<Response | null> {
|
||||
const note = this.body as VersiaNote;
|
||||
const author = await User.resolve(note.author);
|
||||
const instance = await Instance.resolve(note.uri);
|
||||
|
||||
if (!instance) {
|
||||
return Response.json(
|
||||
{ error: "Instance not found" },
|
||||
{ status: 404 },
|
||||
);
|
||||
}
|
||||
|
||||
if (!author) {
|
||||
return Response.json(
|
||||
|
|
@ -285,7 +293,7 @@ export class InboxProcessor {
|
|||
);
|
||||
}
|
||||
|
||||
await Note.fromVersia(note, author);
|
||||
await Note.fromVersia(note, author, instance);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue