diff --git a/assets/locales/de/auth.json b/assets/locales/de/auth.json index e19547a0..f41b67db 100644 --- a/assets/locales/de/auth.json +++ b/assets/locales/de/auth.json @@ -1,16 +1,24 @@ { "login": { - "INVALID_LOGIN": "E-Mail or Phone not found", - "INVALID_PASSWORD": "Invalid Password", - "ACCOUNT_DISABLED": "This account is disabled" + "INVALID_LOGIN": "Ungültiger Benutzername/E-Mail oder Passwort.", + "INVALID_PASSWORD": "Ungültiges Passwort", + "ACCOUNT_DISABLED": "Dieser Account wurde deaktiviert", + "INVALID_TOTP_CODE": "Ungültiger Zwei-Faktor-Authentifierungs-Code.", + "INVALID_TOTP_SECRET": "Ungültiges Zwei-Faktor-Authentifierungs-Secret" }, "register": { - "REGISTRATION_DISABLED": "New user registration is disabled", - "INVITE_ONLY": "You must be invited to register", - "EMAIL_INVALID": "Invalid Email", - "EMAIL_ALREADY_REGISTERED": "Email is already registered", - "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", - "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", - "USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another" + "REGISTRATION_DISABLED": "Die Registrierung von neuen Benutzern ist deaktiviert", + "INVITE_ONLY": "Du musst eingeladen werden, um dich registrieren zu können", + "EMAIL_INVALID": "Ungültige E-Mail-Adresse", + "EMAIL_ALREADY_REGISTERED": "E-Mail-Adresse ist bereits registriert", + "DATE_OF_BIRTH_UNDERAGE": "Du musst mindestens {{years}} Jahre oder älter sein", + "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Das Passwort muss mindestens {{min}} Zeichen lang sein.", + "CONSENT_REQUIRED": "Du musst den Nutzungsbedingungen und der Datenschutzerklärung zustimmen.", + "USERNAME_TOO_MANY_USERS": "Zu viele Nutzer haben diesen Benutzernamen, bitte probiere einen anderen", + "TOO_MANY_REGISTRATIONS": "Zu viele Registrierungen, bitte versuche es später erneut" + }, + "password_reset": { + "EMAIL_DOES_NOT_EXIST": "E-Mail-Adresse existiert nicht.", + "INVALID_TOKEN": "Ungültiger Token." } } diff --git a/assets/locales/en/auth.json b/assets/locales/en/auth.json index 2415c657..bdc90642 100644 --- a/assets/locales/en/auth.json +++ b/assets/locales/en/auth.json @@ -12,9 +12,9 @@ "EMAIL_INVALID": "Invalid Email", "EMAIL_ALREADY_REGISTERED": "Email is already registered", "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", + "PASSWORD_REQUIREMENTS_MIN_LENGTH": "The password must be at least {{min}} characters long.", "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", "USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another", - "GUESTS_DISABLED": "Guest users are disabled", "TOO_MANY_REGISTRATIONS": "Too many registrations, please try again later" }, "password_reset": { diff --git a/assets/locales/ur/auth.json b/assets/locales/ur/auth.json index 1dac2474..7f558d01 100644 --- a/assets/locales/ur/auth.json +++ b/assets/locales/ur/auth.json @@ -10,8 +10,8 @@ "EMAIL_INVALID": "Invalid Email", "EMAIL_ALREADY_REGISTERED": "Email is already registered", "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", - "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Must be at least {{min}} characters long.", - "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", + "PASSWORD_REQUIREMENTS_MIN_LENGTH": "The password must be at least {{min}} characters long.", + "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", "USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another" } } diff --git a/src/api/routes/channels/#channel_id/index.ts b/src/api/routes/channels/#channel_id/index.ts index 567c7c92..99f9a647 100644 --- a/src/api/routes/channels/#channel_id/index.ts +++ b/src/api/routes/channels/#channel_id/index.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -90,6 +90,24 @@ router.delete( } else if (channel.type === ChannelType.GROUP_DM) { await Channel.removeRecipientFromChannel(channel, req.user_id); } else { + if (channel.type == ChannelType.GUILD_CATEGORY) { + const channels = await Channel.find({ + where: { parent_id: channel_id }, + }); + for await (const c of channels) { + c.parent_id = null; + + await Promise.all([ + c.save(), + emitEvent({ + event: "CHANNEL_UPDATE", + data: c, + channel_id: c.id, + } as ChannelUpdateEvent), + ]); + } + } + await Promise.all([ Channel.delete({ id: channel_id }), emitEvent({ diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts index 169eab3d..71ccf49e 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -105,7 +105,7 @@ export class Channel extends BaseClass { @Column({ nullable: true }) @RelationId((channel: Channel) => channel.parent) - parent_id: string; + parent_id: string | null; @JoinColumn({ name: "parent_id" }) @ManyToOne(() => Channel) diff --git a/src/util/entities/UserSettings.ts b/src/util/entities/UserSettings.ts index 0d5d9aad..0d4b6a7b 100644 --- a/src/util/entities/UserSettings.ts +++ b/src/util/entities/UserSettings.ts @@ -63,6 +63,9 @@ export class UserSettings extends BaseClassWithoutId { @Column({ nullable: true }) explicit_content_filter: number = 0; + @Column({ nullable: true }) + friend_discovery_flags: number = 0; + @Column({ nullable: true, type: "simple-json" }) friend_source_flags: FriendSourceFlags = { all: true }; @@ -116,6 +119,10 @@ export class UserSettings extends BaseClassWithoutId { @Column({ nullable: true }) timezone_offset: number = 0; // e.g -60 + + @Column({ nullable: true }) + view_nsfw_guilds: boolean = true; + } interface CustomStatus {