From 557fb35b5a4ae8ad773bb507fc486c41c38dcdc1 Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Sat, 16 Apr 2022 00:22:57 +0300 Subject: Update Identify.ts --- gateway/src/opcodes/Identify.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gateway') diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts index eb15c28f..860000da 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts @@ -29,8 +29,8 @@ const experiments: any = []; import { check } from "./instanceOf"; import { Recipient } from "@fosscord/util"; -// TODO: bot sharding -// TODO: check priviliged intents +// TODO: user sharding +// TODO: check privileged intents, if defined in the config // TODO: check if already identified export async function onIdentify(this: WebSocket, data: Payload) { @@ -87,7 +87,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { user_id: this.user_id, session_id: session_id, // TODO: check if status is only one of: online, dnd, offline, idle - status: identify.presence?.status || "online", //does the session always start as online? + status: identify.presence?.status || "offline", //does the session always start as online? client_info: { //TODO read from identity client: "desktop", @@ -101,7 +101,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { if (!user) return this.close(CLOSECODES.Authentication_failed); - if (!identify.intents) identify.intents = BigInt("0b11111111111111"); + if (!identify.intents) identify.intents = BigInt("0x6ffffffff"); this.intents = new Intents(identify.intents); if (identify.shard) { this.shard_id = identify.shard[0]; @@ -271,7 +271,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { guild_join_requests: [], // TODO what is this? users: users.filter((x) => x).unique(), merged_members: merged_members, - // shard // TODO: only for bots sharding + // shard // TODO: only for user sharding }; // TODO: send real proper data structure -- cgit 1.5.1 From 265f603b0af7f57763d3442d64cfad93aa3f0ad5 Mon Sep 17 00:00:00 2001 From: Thesourtimes Date: Tue, 26 Apr 2022 21:34:15 +0300 Subject: Do stuff for npm workspace --- api/LICENSE | 14 -------------- api/crowdin.yml | 3 --- api/package.json | 2 +- cdn/CONTRIBUTE.md | 18 ------------------ cdn/package.json | 4 ++-- dashboard/LICENSE | 14 -------------- dashboard/package.json | 4 ++-- gateway/LICENSE | 14 -------------- gateway/client.js | 51 -------------------------------------------------- gateway/package.json | 2 +- package.json | 17 +++++++++++++++++ rtc/LICENSE | 14 -------------- util/LICENSE | 14 -------------- util/package.json | 2 +- webrtc/LICENSE | 14 -------------- webrtc/package.json | 4 ++-- 16 files changed, 26 insertions(+), 165 deletions(-) delete mode 100644 api/LICENSE delete mode 100644 api/crowdin.yml delete mode 100644 cdn/CONTRIBUTE.md delete mode 100644 dashboard/LICENSE delete mode 100644 gateway/LICENSE delete mode 100644 gateway/client.js create mode 100644 package.json delete mode 100644 rtc/LICENSE delete mode 100644 util/LICENSE delete mode 100644 webrtc/LICENSE (limited to 'gateway') diff --git a/api/LICENSE b/api/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/api/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/api/crowdin.yml b/api/crowdin.yml deleted file mode 100644 index 7228117f..00000000 --- a/api/crowdin.yml +++ /dev/null @@ -1,3 +0,0 @@ -files: - - source: /locales/en/*.json - translation: /locales/%two_letters_code%/%original_file_name% diff --git a/api/package.json b/api/package.json index c586c9fe..65472522 100644 --- a/api/package.json +++ b/api/package.json @@ -30,7 +30,7 @@ "discord-open-source" ], "author": "Fosscord", - "license": "GPLV3", + "license": "AGPLV3", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/cdn/CONTRIBUTE.md b/cdn/CONTRIBUTE.md deleted file mode 100644 index 7cc673d9..00000000 --- a/cdn/CONTRIBUTE.md +++ /dev/null @@ -1,18 +0,0 @@ -# CONTRIBUTE - -### Setup: - -``` -npm i -npm start -``` - -### Run tests: - -``` -npm test -``` - -#### common errors: - -- db not connecting --> start mongod in a seperate terminal window diff --git a/cdn/package.json b/cdn/package.json index 7a1f43c9..f1d12ba5 100644 --- a/cdn/package.json +++ b/cdn/package.json @@ -14,8 +14,8 @@ "url": "git+https://github.com/fosscord/fosscord-server.git" }, "keywords": [], - "author": "", - "license": "GPLV3", + "author": "Fosscord", + "license": "AGPLV3", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/dashboard/LICENSE b/dashboard/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/dashboard/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/dashboard/package.json b/dashboard/package.json index 1009d658..e71de793 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -14,8 +14,8 @@ "url": "git+https://github.com/fosscord/fosscord-server.git" }, "keywords": [], - "author": "", - "license": "GPLV3", + "author": "Fosscord", + "license": "AGPLV3", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/gateway/LICENSE b/gateway/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/gateway/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/gateway/client.js b/gateway/client.js deleted file mode 100644 index c841c6a0..00000000 --- a/gateway/client.js +++ /dev/null @@ -1,51 +0,0 @@ -require("missing-native-js-functions"); -const WebSocket = require("ws"); -const Constants = require("./dist/util/Constants"); - -// const ws = new WebSocket("ws://127.0.0.1:8080"); -const ws = new WebSocket("wss://dev.fosscord.com"); - -ws.on("open", () => { - // ws.send(JSON.stringify({ req_type: "new_auth" })); - // ws.send(JSON.stringify({ req_type: "check_auth", token: "" })); - // op: 0, - // d: {}, - // s: 42, - // t: "GATEWAY_EVENT_NAME", -}); - -function send(data) { - ws.send(JSON.stringify(data)); -} - -ws.on("message", (buffer) => { - let data = JSON.parse(buffer.toString()); - console.log(data); - - switch (data.op) { - case 10: - setIntervalNow(() => { - send({ op: 1 }); - }, data.d.heartbeat_interval); - - // send({ - // op: 2, - // d: { - // token: - // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjgxMTY0MjkxNzQzMjA2NjA0OCIsImlhdCI6MTYxMzU4MTE1MX0.7Qj_z2lYIgJ0rc7NfGtpW5DKGqecQfv1mLpoBUQHKDc", - // intents: 0n, - // properties: {}, - // }, - // }); - - send({ - op: 6, - }); - - break; - } -}); - -ws.on("close", (code, reason) => { - console.log(code, reason, Constants.CLOSECODES[code]); -}); diff --git a/gateway/package.json b/gateway/package.json index 6d0d2d1c..92d812b4 100644 --- a/gateway/package.json +++ b/gateway/package.json @@ -13,7 +13,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "GPLV3", + "license": "AGPLV3", "devDependencies": { "@types/amqplib": "^0.8.1", "@types/jsonwebtoken": "^8.5.0", diff --git a/package.json b/package.json new file mode 100644 index 00000000..0fa46c7a --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "fosscord-server", + "version": "1.0.0", + "description": "A Fosscord server written in Node.js", + "workspaces": ["api", "bundle", "cdn", "gateway", "webrtc"], + "scripts": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/fosscord/fosscord-server.git" + }, + "author": "Fosscord", + "license": "AGPLV3", + "bugs": { + "url": "https://github.com/fosscord/fosscord-server/issues" + }, + "homepage": "https://fosscord.com" +} diff --git a/rtc/LICENSE b/rtc/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/rtc/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/util/LICENSE b/util/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/util/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/util/package.json b/util/package.json index d7baed9a..7251d3e4 100644 --- a/util/package.json +++ b/util/package.json @@ -23,7 +23,7 @@ "discord-open-source" ], "author": "Fosscord", - "license": "GPLV3", + "license": "AGPLV3", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/webrtc/LICENSE b/webrtc/LICENSE deleted file mode 100644 index f19bf520..00000000 --- a/webrtc/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2021 Fosscord and 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 . \ No newline at end of file diff --git a/webrtc/package.json b/webrtc/package.json index 0f700728..ab9e7486 100644 --- a/webrtc/package.json +++ b/webrtc/package.json @@ -9,8 +9,8 @@ "start": "npm run build && node dist/start.js" }, "keywords": [], - "author": "", - "license": "ISC", + "author": "Fosscord", + "license": "AGPLV3", "devDependencies": { "@types/node": "^15.6.1", "@types/ws": "^7.4.4", -- cgit 1.5.1 From 5adcd70a5171ae807f5fcbcd65eb6a5938c6386a Mon Sep 17 00:00:00 2001 From: KaKi87 Date: Thu, 2 Jun 2022 17:33:50 +0200 Subject: Use SPDX license syntax in 'package.json' files --- api/package.json | 2 +- bundle/package.json | 2 +- cdn/package.json | 2 +- dashboard/package.json | 2 +- gateway/package.json | 2 +- package.json | 2 +- util/package.json | 2 +- webrtc/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gateway') diff --git a/api/package.json b/api/package.json index 65472522..29fa82a1 100644 --- a/api/package.json +++ b/api/package.json @@ -30,7 +30,7 @@ "discord-open-source" ], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/bundle/package.json b/bundle/package.json index 7d68427f..d44d257f 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -18,7 +18,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/cdn/package.json b/cdn/package.json index f1d12ba5..46405b88 100644 --- a/cdn/package.json +++ b/cdn/package.json @@ -15,7 +15,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/dashboard/package.json b/dashboard/package.json index e71de793..9afe20f8 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -15,7 +15,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/gateway/package.json b/gateway/package.json index 92d812b4..7a3b1012 100644 --- a/gateway/package.json +++ b/gateway/package.json @@ -13,7 +13,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "devDependencies": { "@types/amqplib": "^0.8.1", "@types/jsonwebtoken": "^8.5.0", diff --git a/package.json b/package.json index 3395122e..8488ff28 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "url": "git+https://github.com/fosscord/fosscord-server.git" }, "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/util/package.json b/util/package.json index 7251d3e4..35d2fbbe 100644 --- a/util/package.json +++ b/util/package.json @@ -23,7 +23,7 @@ "discord-open-source" ], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/fosscord/fosscord-server/issues" }, diff --git a/webrtc/package.json b/webrtc/package.json index ab9e7486..d973dd7e 100644 --- a/webrtc/package.json +++ b/webrtc/package.json @@ -10,7 +10,7 @@ }, "keywords": [], "author": "Fosscord", - "license": "AGPLV3", + "license": "AGPL-3.0-only", "devDependencies": { "@types/node": "^15.6.1", "@types/ws": "^7.4.4", -- cgit 1.5.1