Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(api): keep a deprecated nsfw field for older clients (#2463)

Hampus3f1f899b235d
diff --git a/fluxer_api/src/api/guild/GuildModel.ts b/fluxer_api/src/api/guild/GuildModel.ts
index 9dd7d34c3..f7b24d012 100644
--- a/fluxer_api/src/api/guild/GuildModel.ts
+++ b/fluxer_api/src/api/guild/GuildModel.ts
@@ -116,6 +116,7 @@ export function mapGuildEmojiToResponse(emoji: GuildEmoji): z.infer<typeof Guild
id,
name: emoji.name,
animated: emoji.isAnimated,
+ nsfw: false,
};
}
@@ -127,6 +128,7 @@ export function mapGuildStickerToResponse(sticker: GuildSticker): z.infer<typeof
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
+ nsfw: false,
};
}
@@ -178,6 +180,7 @@ function mapEmojiWithUser(
id,
name: emoji.name,
animated: emoji.isAnimated,
+ nsfw: false,
user: userPartial,
};
}
@@ -204,6 +207,7 @@ function mapStickerWithUser(
description: sticker.description ?? '',
tags: sticker.tags,
animated: sticker.animated,
+ nsfw: false,
user: userPartial,
};
}
diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.json
index 6ddf6eef7..57f88acbd 100644
--- a/fluxer_api/src/api/openapi/openapi.json
+++ b/fluxer_api/src/api/openapi/openapi.json
@@ -27925,9 +27925,13 @@
"description": "The unique identifier for this emoji"
},
"name": {"type": "string", "description": "The name of the emoji"},
- "animated": {"type": "boolean", "description": "Whether this emoji is animated"}
+ "animated": {"type": "boolean", "description": "Whether this emoji is animated"},
+ "nsfw": {
+ "type": "boolean",
+ "description": "Deprecated; always false. Retained for compatibility with older clients"
+ }
},
- "required": ["id", "name", "animated"]
+ "required": ["id", "name", "animated", "nsfw"]
},
"GuildStickerResponse": {
"type": "object",
@@ -27945,9 +27949,13 @@
"maxItems": 100,
"description": "Autocomplete/suggestion tags for the sticker"
},
- "animated": {"type": "boolean", "description": "Whether this sticker is animated"}
+ "animated": {"type": "boolean", "description": "Whether this sticker is animated"},
+ "nsfw": {
+ "type": "boolean",
+ "description": "Deprecated; always false. Retained for compatibility with older clients"
+ }
},
- "required": ["id", "name", "description", "tags", "animated"]
+ "required": ["id", "name", "description", "tags", "animated", "nsfw"]
},
"GuildCreateRequest": {
"type": "object",
@@ -28931,9 +28939,13 @@
},
"name": {"type": "string", "description": "The name of the emoji"},
"animated": {"type": "boolean", "description": "Whether this emoji is animated"},
+ "nsfw": {
+ "type": "boolean",
+ "description": "Deprecated; always false. Retained for compatibility with older clients"
+ },
"user": {"$ref": "#/components/schemas/UserPartialResponse"}
},
- "required": ["id", "name", "animated", "user"]
+ "required": ["id", "name", "animated", "nsfw", "user"]
},
"GuildEmojiBulkCreateResponse": {
"type": "object",
@@ -29430,9 +29442,13 @@
"description": "Autocomplete/suggestion tags for the sticker"
},
"animated": {"type": "boolean", "description": "Whether this sticker is animated"},
+ "nsfw": {
+ "type": "boolean",
+ "description": "Deprecated; always false. Retained for compatibility with older clients"
+ },
"user": {"$ref": "#/components/schemas/UserPartialResponse"}
},
- "required": ["id", "name", "description", "tags", "animated", "user"]
+ "required": ["id", "name", "description", "tags", "animated", "nsfw", "user"]
},
"GuildStickerBulkCreateResponse": {
"type": "object",
diff --git a/packages/schema/src/domains/guild/GuildEmojiSchemas.ts b/packages/schema/src/domains/guild/GuildEmojiSchemas.ts
index 2f44cf810..17ec12472 100644
--- a/packages/schema/src/domains/guild/GuildEmojiSchemas.ts
+++ b/packages/schema/src/domains/guild/GuildEmojiSchemas.ts
@@ -8,6 +8,7 @@ export const GuildEmojiResponse = z.object({
id: SnowflakeStringType.describe('The unique identifier for this emoji'),
name: z.string().describe('The name of the emoji'),
animated: z.boolean().describe('Whether this emoji is animated'),
+ nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
});
export type GuildEmojiResponse = z.infer<typeof GuildEmojiResponse>;
@@ -16,6 +17,7 @@ export const GuildEmojiWithUserResponse = z.object({
id: SnowflakeStringType.describe('The unique identifier for this emoji'),
name: z.string().describe('The name of the emoji'),
animated: z.boolean().describe('Whether this emoji is animated'),
+ nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
user: z.lazy(() => UserPartialResponse).describe('The user who uploaded this emoji'),
});
@@ -27,6 +29,7 @@ export const GuildStickerResponse = z.object({
description: z.string().describe('The description of the sticker'),
tags: z.array(z.string()).max(100).describe('Autocomplete/suggestion tags for the sticker'),
animated: z.boolean().describe('Whether this sticker is animated'),
+ nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
});
export type GuildStickerResponse = z.infer<typeof GuildStickerResponse>;
@@ -37,6 +40,7 @@ export const GuildStickerWithUserResponse = z.object({
description: z.string().describe('The description of the sticker'),
tags: z.array(z.string()).max(100).describe('Autocomplete/suggestion tags for the sticker'),
animated: z.boolean().describe('Whether this sticker is animated'),
+ nsfw: z.boolean().describe('Deprecated; always false. Retained for compatibility with older clients'),
user: z.lazy(() => UserPartialResponse).describe('The user who uploaded this sticker'),
});