1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

update defaults

This commit is contained in:
Erkin Alp Güney 2022-01-12 16:13:13 +03:00 committed by GitHub
parent 277b28c000
commit 67282af0b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,7 +213,7 @@ export class Guild extends BaseClass {
owner: User;
@Column({ nullable: true })
preferred_locale?: string; // only community guilds can choose this
preferred_locale?: string;
@Column({ nullable: true })
premium_subscription_count?: number;
@ -301,22 +301,22 @@ export class Guild extends BaseClass {
name: body.name || "Fosscord",
icon: await handleFile(`/icons/${guild_id}`, body.icon as string),
region: Config.get().regions.default,
owner_id: body.owner_id,
owner_id: body.owner_id, // TODO: need to figure out a way for ownerless guilds and multiply-owned guilds
afk_timeout: 300,
default_message_notifications: 0,
default_message_notifications: 1, // defaults effect: setting the push default at mentions-only will save a lot
explicit_content_filter: 0,
features: [],
id: guild_id,
max_members: 250000,
max_presences: 250000,
max_video_channel_users: 25,
max_video_channel_users: 200,
presence_count: 0,
member_count: 0, // will automatically be increased by addMember()
mfa_level: 0,
preferred_locale: "en-US",
premium_subscription_count: 0,
premium_tier: 0,
system_channel_flags: 0,
system_channel_flags: 4, // defaults effect: suppress the setup tips to save performance
unavailable: false,
nsfw: false,
nsfw_level: 0,
@ -326,7 +326,7 @@ export class Guild extends BaseClass {
description: "No description",
welcome_channels: [],
},
widget_enabled: false,
widget_enabled: true, // NB: don't set it as false to prevent artificial restrictions
}).save();
// we have to create the role _after_ the guild because else we would get a "SQLITE_CONSTRAINT: FOREIGN KEY constraint failed" error
@ -337,6 +337,7 @@ export class Guild extends BaseClass {
color: 0,
hoist: false,
managed: false,
// NB: in Fosscord, every role will be non-managed, as we use user-groups instead of roles for managed groups
mentionable: false,
name: "@everyone",
permissions: String("2251804225"),
@ -358,7 +359,6 @@ export class Guild extends BaseClass {
for (const channel of body.channels?.sort((a, b) => (a.parent_id ? 1 : -1))) {
var id = ids.get(channel.id) || Snowflake.generate();
// TODO: should we abort if parent_id is a category? (to disallow sub category channels)
var parent_id = ids.get(channel.parent_id);
await Channel.createChannel({ ...channel, guild_id, id, parent_id }, body.owner_id, {