From ca42df1dfd56f1cd9aedcece55b9e48b0ed23a3b Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 29 Nov 2024 21:49:41 +0100 Subject: [PATCH] fix(api): :bug: Properly include `global` field in API emojis --- bun.lockb | Bin 381216 -> 381216 bytes classes/database/emoji.ts | 5 +++-- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bun.lockb b/bun.lockb index f5c170abb28c5770d85e048f1a705bd77b6632ad..a9cb2cb3d05d96fa9c16730f8b304f4b284662c9 100755 GIT binary patch delta 166 zcmV;X09pT_q8Ff|7mzL>Q%*ssgl?^vG;=^PblK!>AM8*5Sps*u>!ZXu>I50LM(PCG=5b|CI{*Lx delta 166 zcmV;X09pT_q8Ff|7mzL>8D47f3HRAL#?|Xl9v6z+;g55oc`j_Fv$Ya0H8QiBu}(U8 zlgLgmgSdFNxOf4*I6z|P*tiD%v=(1wYZmV51q;3Z{>-u3lUQ~qx}-#dIMEPh*5E%& z^3vu2J!C+~9&n)VOeF07ns5jEhAps*u>!ZXu>I50LM(PCG=C~eFQ~&?~ diff --git a/classes/database/emoji.ts b/classes/database/emoji.ts index 55158f2e..a3131af7 100644 --- a/classes/database/emoji.ts +++ b/classes/database/emoji.ts @@ -1,6 +1,6 @@ import { emojiValidatorWithColons, emojiValidatorWithIdentifiers } from "@/api"; import { proxyUrl } from "@/response"; -import type { Emoji as ApiEmoji } from "@versia/client/types"; +import type { Emoji as APIEmoji } from "@versia/client/types"; import type { CustomEmojiExtension } from "@versia/federation/types"; import { db } from "@versia/kit/db"; import { Emojis, Instances } from "@versia/kit/tables"; @@ -187,7 +187,7 @@ export class Emoji extends BaseInterface { ); } - public toApi(): ApiEmoji & { id: string } { + public toApi(): APIEmoji { return { id: this.id, shortcode: this.data.shortcode, @@ -195,6 +195,7 @@ export class Emoji extends BaseInterface { url: proxyUrl(this.data.url) ?? "", visible_in_picker: this.data.visibleInPicker, category: this.data.category ?? undefined, + global: this.data.ownerId === null, }; } diff --git a/package.json b/package.json index ba6c2438..302e2c5c 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "@oclif/core": "^4.0.33", "@sentry/bun": "^8.41.0", "@tufjs/canonical-json": "^2.0.0", - "@versia/client": "^0.1.1", + "@versia/client": "^0.1.2", "@versia/federation": "^0.1.4", "@versia/kit": "workspace:*", "altcha-lib": "^1.1.1",