From 976f76d5248aa31c5a33b5102869b664b5b52532 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 11 Oct 2021 16:34:18 +0200 Subject: :art: gifs --- api/src/util/Message.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'api/src/util') diff --git a/api/src/util/Message.ts b/api/src/util/Message.ts index f8230124..40d96b42 100644 --- a/api/src/util/Message.ts +++ b/api/src/util/Message.ts @@ -25,6 +25,7 @@ import cheerio from "cheerio"; import { MessageCreateSchema } from "../routes/channels/#channel_id/messages"; // TODO: check webhook, application, system author +// TODO: embed gifs/videos/images const LINK_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g; -- cgit 1.5.1 From 4e6ffcbc4f47392ee8119c18e8f1af625d7f97af Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:32:15 +0200 Subject: :bug: fix migration + autojoin --- api/src/util/Instance.ts | 2 +- util/src/migrations/migrate_db_engine.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'api/src/util') diff --git a/api/src/util/Instance.ts b/api/src/util/Instance.ts index a7b3205a..d1d9e1ab 100644 --- a/api/src/util/Instance.ts +++ b/api/src/util/Instance.ts @@ -8,7 +8,7 @@ export async function initInstance() { // TODO: check if any current user is not part of autoJoinGuilds const { autoJoin } = Config.get().guild; - if (autoJoin.enabled && autoJoin.guilds?.length) { + if (autoJoin.enabled && !autoJoin.guilds?.length) { let guild = await Guild.findOne({}); if (!guild) guild = await Guild.createGuild({}); diff --git a/util/src/migrations/migrate_db_engine.js b/util/src/migrations/migrate_db_engine.js index eab30bc4..79e9d86f 100644 --- a/util/src/migrations/migrate_db_engine.js +++ b/util/src/migrations/migrate_db_engine.js @@ -8,6 +8,7 @@ const { Attachment, Ban, Channel, + ConfigEntity, ConnectedAccount, Emoji, Guild, @@ -32,6 +33,7 @@ async function main() { // manually arrange them because of foreign keys const entities = [ + ConfigEntity, User, Guild, Channel, @@ -61,12 +63,13 @@ async function main() { const isSqlite = type.includes("sqlite"); // @ts-ignore - const oldDB = await createConnection({ + const newDB = await createConnection({ type, url: isSqlite ? undefined : process.env.TO, database: isSqlite ? process.env.TO : undefined, entities, - name: "old", + name: "new", + synchronize: true, }); let i = 0; -- cgit 1.5.1 From 5cc5ea3f046e061c338d5c990020ea4de5484d11 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 14 Oct 2021 21:25:17 +0200 Subject: :art: do not automatically create default guild --- api/src/util/Instance.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'api/src/util') diff --git a/api/src/util/Instance.ts b/api/src/util/Instance.ts index d1d9e1ab..7dcd126e 100644 --- a/api/src/util/Instance.ts +++ b/api/src/util/Instance.ts @@ -10,9 +10,9 @@ export async function initInstance() { if (autoJoin.enabled && !autoJoin.guilds?.length) { let guild = await Guild.findOne({}); - if (!guild) guild = await Guild.createGuild({}); - - // @ts-ignore - await Config.set({ guild: { autoJoin: { guilds: [guild.id] } } }); + if (guild) { + // @ts-ignore + await Config.set({ guild: { autoJoin: { guilds: [guild.id] } } }); + } } } -- cgit 1.5.1