mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-14 02:55:39 +00:00
Some minor work
This commit is contained in:
26
src/api/global.d.ts
vendored
26
src/api/global.d.ts
vendored
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// declare global {
|
||||
// namespace Express {
|
||||
// interface Request {
|
||||
// user_id: any;
|
||||
// token: any;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -18,12 +18,13 @@
|
||||
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@spacebar/api";
|
||||
import { IpDataClient } from "@spacebar/util*";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
router.get("/", route({}), (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json({ country_code: "US" }).status(200);
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
const country_code = (await IpDataClient.getIpInfo(req.ip!))?.country_code;
|
||||
res.json({ country_code: country_code }).status(200);
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -18,13 +18,14 @@
|
||||
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@spacebar/api";
|
||||
import { IpDataClient } from "@spacebar/util*";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
router.get("/", route({}), (req: Request, res: Response) => {
|
||||
//TODO
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
// TODO: subdivision_code (optional)
|
||||
res.json({ country_code: "US" }).status(200);
|
||||
const country_code = (await IpDataClient.getIpInfo(req.ip!))?.country_code;
|
||||
res.json({ country_code: country_code }).status(200);
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -651,7 +651,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
private_channels: channels,
|
||||
presences: [], // TODO: Send actual data
|
||||
session_id: this.session_id,
|
||||
country_code: user.settings!.locale, // TODO: do ip analysis instead
|
||||
country_code: this.session?.last_seen_location_info?.country_code ?? user.settings!.locale,
|
||||
users: Array.from(users),
|
||||
merged_members: merged_members,
|
||||
sessions: allSessions,
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export class ClientReleaseConfiguration {
|
||||
useLocalRelease: boolean = true; //TODO
|
||||
upstreamVersion: string = "0.0.264";
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from "./ClientReleaseConfiguration";
|
||||
@@ -16,7 +16,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from "./client";
|
||||
export * from "./defaults";
|
||||
export * from "./guild";
|
||||
export * from "./kafka";
|
||||
|
||||
@@ -59,7 +59,7 @@ export class Session extends BaseClassWithoutId {
|
||||
client_status: ClientStatus;
|
||||
|
||||
@Column({ nullable: false, type: String })
|
||||
status: Status; //TODO enum
|
||||
status: Status;
|
||||
|
||||
@Column({ default: false })
|
||||
is_admin_session: boolean;
|
||||
|
||||
Reference in New Issue
Block a user