1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +01:00

Merge branch 'master' into slowcord

This commit is contained in:
Madeline 2022-02-11 22:03:21 +11:00
commit 84b8173f80
9 changed files with 271 additions and 1770 deletions

View File

@ -54,9 +54,14 @@
setInterval(() => { setInterval(() => {
var token = JSON.parse(localStorage.getItem("token")); var token = JSON.parse(localStorage.getItem("token"));
if (token) { if (token) {
var logincss = document.querySelector('#logincss'),
canRemove = logincss ? logincss: "";
if(canRemove !== "") {
document.querySelector("#logincss").remove(); document.querySelector("#logincss").remove();
canRemove = "";
}
} }
}, 1000); }, 1000)
const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); const settings = JSON.parse(localStorage.getItem("UserSettingsStore"));
if (settings && settings.locale.length <= 2) { if (settings && settings.locale.length <= 2) {

1
api/package-lock.json generated
View File

@ -34,6 +34,7 @@
"missing-native-js-functions": "^1.2.18", "missing-native-js-functions": "^1.2.18",
"morgan": "^1.10.0", "morgan": "^1.10.0",
"multer": "^1.4.2", "multer": "^1.4.2",
"node": ">=15.0",
"node-fetch": "^3.1.1", "node-fetch": "^3.1.1",
"patch-package": "^6.4.7", "patch-package": "^6.4.7",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",

View File

@ -219,7 +219,10 @@ router.post(
}) })
); );
} }
//Fix for the client bug
delete message.member
await Promise.all([ await Promise.all([
message.save(), message.save(),
emitEvent({ event: "MESSAGE_CREATE", channel_id: channel_id, data: message } as MessageCreateEvent), emitEvent({ event: "MESSAGE_CREATE", channel_id: channel_id, data: message } as MessageCreateEvent),

1992
bundle/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -94,14 +94,14 @@
"morgan": "^1.10.0", "morgan": "^1.10.0",
"multer": "^1.4.2", "multer": "^1.4.2",
"nanocolors": "^0.2.12", "nanocolors": "^0.2.12",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.2",
"node-os-utils": "^1.3.5", "node-os-utils": "^1.3.5",
"patch-package": "^6.4.7", "patch-package": "^6.4.7",
"pg": "^8.7.1", "pg": "^8.7.1",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"proxy-agent": "^5.0.0", "proxy-agent": "^5.0.0",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"sqlite3": "^5.0.2", "sqlite3": "^4.2.0",
"supertest": "^6.1.6", "supertest": "^6.1.6",
"tslib": "^2.3.1", "tslib": "^2.3.1",
"typeorm": "^0.2.37", "typeorm": "^0.2.37",
@ -110,4 +110,4 @@
"typescript-json-schema": "^0.50.1", "typescript-json-schema": "^0.50.1",
"ws": "^7.4.2" "ws": "^7.4.2"
} }
} }

12
util/package-lock.json generated
View File

@ -6662,9 +6662,9 @@
"peer": true "peer": true
}, },
"node_modules/simple-get": { "node_modules/simple-get": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz",
"integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==",
"optional": true, "optional": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -13356,9 +13356,9 @@
"peer": true "peer": true
}, },
"simple-get": { "simple-get": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz",
"integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==",
"optional": true, "optional": true,
"peer": true, "peer": true,
"requires": { "requires": {

View File

@ -41,6 +41,6 @@ export class Emoji extends BaseClass {
@Column({ type: "simple-array" }) @Column({ type: "simple-array" })
roles: string[]; // roles this emoji is whitelisted to (new discord feature?) roles: string[]; // roles this emoji is whitelisted to (new discord feature?)
@Column({ type: "simple-array" }) @Column({ type: "simple-array", nullable: true })
groups: string[]; // user groups this emoji is whitelisted to (Fosscord extension) groups: string[]; // user groups this emoji is whitelisted to (Fosscord extension)
} }

View File

@ -25,6 +25,7 @@ export function initDatabase(): Promise<Connection> {
// @ts-ignore // @ts-ignore
promise = createConnection({ promise = createConnection({
type, type,
charset: 'utf8mb4',
url: isSqlite ? undefined : dbConnectionString, url: isSqlite ? undefined : dbConnectionString,
database: isSqlite ? dbConnectionString : undefined, database: isSqlite ? dbConnectionString : undefined,
// @ts-ignore // @ts-ignore

View File

@ -35,9 +35,9 @@ export class Rights extends BitField {
ADD_MEMBERS: BitFlag(8), // can manually add any members in their guilds ADD_MEMBERS: BitFlag(8), // can manually add any members in their guilds
BYPASS_RATE_LIMITS: BitFlag(9), BYPASS_RATE_LIMITS: BitFlag(9),
CREATE_APPLICATIONS: BitFlag(10), CREATE_APPLICATIONS: BitFlag(10),
CREATE_CHANNELS: BitFlag(11), CREATE_CHANNELS: BitFlag(11), // can create guild channels or threads in the guilds that they have permission
CREATE_DMS: BitFlag(12), CREATE_DMS: BitFlag(12),
CREATE_DM_GROUPS: BitFlag(13), CREATE_DM_GROUPS: BitFlag(13), // can create group DMs or custom orphan channels
CREATE_GUILDS: BitFlag(14), CREATE_GUILDS: BitFlag(14),
CREATE_INVITES: BitFlag(15), // can create mass invites in the guilds that they have CREATE_INSTANT_INVITE CREATE_INVITES: BitFlag(15), // can create mass invites in the guilds that they have CREATE_INSTANT_INVITE
CREATE_ROLES: BitFlag(16), CREATE_ROLES: BitFlag(16),
@ -57,6 +57,17 @@ export class Rights extends BitField {
SELF_DELETE_DISABLE: BitFlag(30), // can disable/delete own account SELF_DELETE_DISABLE: BitFlag(30), // can disable/delete own account
DEBTABLE: BitFlag(31), // can use pay-to-use features DEBTABLE: BitFlag(31), // can use pay-to-use features
CREDITABLE: BitFlag(32), // can receive money from monetisation related features CREDITABLE: BitFlag(32), // can receive money from monetisation related features
KICK_BAN_MEMBERS: BitFlag(33),
// can kick or ban guild or group DM members in the guilds/groups that they have KICK_MEMBERS, or BAN_MEMBERS
SELF_LEAVE_GROUPS: BitFlag(34),
// can leave the guilds or group DMs that they joined on their own (one can always leave a guild or group DMs they have been force-added)
PRESENCE: BitFlag(35),
// inverts the presence confidentiality default (OPERATOR's presence is not routed by default, others' are) for a given user
SELF_ADD_DISCOVERABLE: BitFlag(36), // can mark discoverable guilds that they have permissions to mark as discoverable
MANAGE_GUILD_DIRECTORY: BitFlag(37), // can change anything in the primary guild directory
INITIATE_INTERACTIONS: BitFlag(40), // can initiate interactions
RESPOND_TO_INTERACTIONS: BitFlag(41), // can respond to interactions
SEND_BACKDATED_EVENTS: BitFlag(42), // can send backdated events
}; };
any(permission: RightResolvable, checkOperator = true) { any(permission: RightResolvable, checkOperator = true) {