mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-10 17:52:25 +02:00
ts-node building; for some reason it doesn't read the base config
This commit is contained in:
parent
bed7cc04f5
commit
2693a766f1
|
@ -36,7 +36,6 @@ module.exports = {
|
||||||
"no-else-return": "error",
|
"no-else-return": "error",
|
||||||
"no-implicit-globals": "error",
|
"no-implicit-globals": "error",
|
||||||
"no-restricted-globals": ["error", "event", "fdescribe"],
|
"no-restricted-globals": ["error", "event", "fdescribe"],
|
||||||
"no-shadow": "error",
|
|
||||||
"no-template-curly-in-string": "error",
|
"no-template-curly-in-string": "error",
|
||||||
"no-unsafe-negation": "error",
|
"no-unsafe-negation": "error",
|
||||||
"no-useless-computed-key": "error",
|
"no-useless-computed-key": "error",
|
||||||
|
@ -90,12 +89,14 @@ module.exports = {
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
"@typescript-eslint/no-unused-vars": "off",
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
"@typescript-eslint/no-this-alias": "off",
|
"@typescript-eslint/no-this-alias": "off",
|
||||||
|
"no-shadow": "off",
|
||||||
|
"@typescript-eslint/no-shadow": "error",
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: verify
|
// TODO: verify
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["*.vue", "*.d.ts"],
|
files: ["*.vue"],
|
||||||
rules: {
|
rules: {
|
||||||
"import/no-default-export": 0,
|
"import/no-default-export": 0,
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,8 @@ import VueApp from "vue";
|
||||||
declare module "vue/types/vue" {
|
declare module "vue/types/vue" {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
debouncedResize: () => void;
|
debouncedResize: () => void;
|
||||||
dayChangeTimeout: number;
|
// TODO; type as Timeout
|
||||||
|
dayChangeTimeout: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import constants from "../js/constants";
|
import constants from "../js/constants";
|
||||||
import eventbus from "../js/eventbus";
|
import eventbus from "../js/eventbus";
|
||||||
import clipboard from "../js/clipboard";
|
import clipboard from "../js/clipboard";
|
||||||
|
@ -65,10 +65,18 @@ import socket from "../js/socket";
|
||||||
import Message from "./Message.vue";
|
import Message from "./Message.vue";
|
||||||
import MessageCondensed from "./MessageCondensed.vue";
|
import MessageCondensed from "./MessageCondensed.vue";
|
||||||
import DateMarker from "./DateMarker.vue";
|
import DateMarker from "./DateMarker.vue";
|
||||||
|
import Vue, {PropType} from "vue";
|
||||||
|
import type Network from "../../src/types/models/network";
|
||||||
|
import type Channel from "../../src/types/models/channel";
|
||||||
|
|
||||||
let unreadMarkerShown = false;
|
let unreadMarkerShown = false;
|
||||||
|
|
||||||
export default {
|
type CondensedMessage = Message & {
|
||||||
|
// TODO; better type
|
||||||
|
type: "condensed" | string;
|
||||||
|
messages: Message[];
|
||||||
|
};
|
||||||
|
export default Vue.extend({
|
||||||
name: "MessageList",
|
name: "MessageList",
|
||||||
components: {
|
components: {
|
||||||
Message,
|
Message,
|
||||||
|
@ -76,8 +84,8 @@ export default {
|
||||||
DateMarker,
|
DateMarker,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
network: Object,
|
network: Object as PropType<Network>,
|
||||||
channel: Object,
|
channel: Object as PropType<ClientChan>,
|
||||||
focused: String,
|
focused: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -98,8 +106,8 @@ export default {
|
||||||
return this.channel.messages;
|
return this.channel.messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
const condensed = [];
|
const condensed: CondensedMessage[] = [];
|
||||||
let lastCondensedContainer = null;
|
let lastCondensedContainer: null | CondensedMessage = null;
|
||||||
|
|
||||||
for (const message of this.channel.messages) {
|
for (const message of this.channel.messages) {
|
||||||
// If this message is not condensable, or its an action affecting our user,
|
// If this message is not condensable, or its an action affecting our user,
|
||||||
|
@ -123,14 +131,14 @@ export default {
|
||||||
messages: [],
|
messages: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
condensed.push(lastCondensedContainer);
|
condensed.push(lastCondensedContainer!);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastCondensedContainer.messages.push(message);
|
lastCondensedContainer!.messages.push(message);
|
||||||
|
|
||||||
// Set id of the condensed container to last message id,
|
// Set id of the condensed container to last message id,
|
||||||
// which is required for the unread marker to work correctly
|
// which is required for the unread marker to work correctly
|
||||||
lastCondensedContainer.id = message.id;
|
lastCondensedContainer!.id = message.id;
|
||||||
|
|
||||||
// If this message is the unread boundary, create a split condensed container
|
// If this message is the unread boundary, create a split condensed container
|
||||||
if (message.id === this.channel.firstUnread) {
|
if (message.id === this.channel.firstUnread) {
|
||||||
|
@ -354,5 +362,5 @@ export default {
|
||||||
el.scrollTop = el.scrollHeight;
|
el.scrollTop = el.scrollHeight;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://thelounge.chat/",
|
"homepage": "https://thelounge.chat/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build:client": "webpack",
|
||||||
|
"build:server": "tsc -p src/tsconfig.json index.ts",
|
||||||
"coverage": "run-s test:* && nyc --nycrc-path=test/.nycrc-report.json report",
|
"coverage": "run-s test:* && nyc --nycrc-path=test/.nycrc-report.json report",
|
||||||
"dev": "ts-node index start --dev",
|
"dev": "ts-node --project tsconfig.json index.ts start --dev",
|
||||||
"format:prettier": "prettier --write \"**/*.*\"",
|
"format:prettier": "prettier --write \"**/*.*\"",
|
||||||
"lint:check-eslint": "eslint-config-prettier .eslintrc.cjs",
|
"lint:check-eslint": "eslint-config-prettier .eslintrc.cjs",
|
||||||
"lint:eslint": "eslint . --ext .js,.vue --report-unused-disable-directives --color",
|
"lint:eslint": "eslint . --ext .js,.vue --report-unused-disable-directives --color",
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import colors from "chalk";
|
import colors from "chalk";
|
||||||
import log from "../../log";
|
import log from "../../log";
|
||||||
import Helper from "../../helper";
|
import Helper from "../../helper";
|
||||||
import {AuthHandler} from "types/plugins/auth";
|
import {AuthHandler} from "../../types/plugins/auth";
|
||||||
|
|
||||||
const localAuth: AuthHandler = (manager, client, user, password, callback) => {
|
const localAuth: AuthHandler = (manager, client, user, password, callback) => {
|
||||||
// If no user is found, or if the client has not provided a password,
|
// If no user is found, or if the client has not provided a password,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import got, {Response} from "got";
|
||||||
import colors from "chalk";
|
import colors from "chalk";
|
||||||
import log from "../log";
|
import log from "../log";
|
||||||
import pkg from "../../package.json";
|
import pkg from "../../package.json";
|
||||||
import ClientManager from "clientManager";
|
import ClientManager from "../clientManager";
|
||||||
|
|
||||||
const TIME_TO_LIVE = 15 * 60 * 1000; // 15 minutes, in milliseconds
|
const TIME_TO_LIVE = 15 * 60 * 1000; // 15 minutes, in milliseconds
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Chan from "models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
const clientSideCommands = ["/collapse", "/expand", "/search"];
|
const clientSideCommands = ["/collapse", "/expand", "/search"];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Chan from "../../models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
import Chan from "models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
import Client from "client";
|
import Client from "../../client";
|
||||||
|
|
||||||
const commands = ["mute", "unmute"];
|
const commands = ["mute", "unmute"];
|
||||||
const allowDisconnected = true;
|
const allowDisconnected = true;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import Helper from "../../helper";
|
import Helper from "../../helper";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
import Config from "../../config";
|
import Config from "../../config";
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
export default <IrcEventHandler>function (irc, network) {
|
export default <IrcEventHandler>function (irc, network) {
|
||||||
const client = this;
|
const client = this;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import {ChanState} from "types/models/channel";
|
import {ChanState} from "../../types/models/channel";
|
||||||
|
|
||||||
import {Network} from "types/models/network";
|
import {Network} from "../../types/models/network";
|
||||||
|
|
||||||
import Chan from "../../models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
|
@ -5,14 +5,14 @@ import got from "got";
|
||||||
import {URL} from "url";
|
import {URL} from "url";
|
||||||
import mime from "mime-types";
|
import mime from "mime-types";
|
||||||
|
|
||||||
|
import log from "../../log";
|
||||||
import Config from "../../config";
|
import Config from "../../config";
|
||||||
import {findLinksWithSchema} from "../../../client/js/helpers/ircmessageparser/findLinks";
|
import {findLinksWithSchema} from "../../../client/js/helpers/ircmessageparser/findLinks";
|
||||||
import storage from "../storage";
|
import storage from "../storage";
|
||||||
import log from "log";
|
import Client from "../../client";
|
||||||
import Client from "client";
|
import Chan from "../../models/chan";
|
||||||
import Chan from "models/chan";
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
import {Preview} from "types/plugins/preview";
|
import {Preview} from "../../types/plugins/preview";
|
||||||
|
|
||||||
const currentFetchPromises = new Map();
|
const currentFetchPromises = new Map();
|
||||||
const imageTypeRegex = /^image\/.+/;
|
const imageTypeRegex = /^image\/.+/;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import Msg from "../../models/msg";
|
||||||
import LinkPrefetch from "./link";
|
import LinkPrefetch from "./link";
|
||||||
import cleanIrcMessage from "../../../client/js/helpers/ircmessageparser/cleanIrcMessage";
|
import cleanIrcMessage from "../../../client/js/helpers/ircmessageparser/cleanIrcMessage";
|
||||||
import Helper from "../../helper";
|
import Helper from "../../helper";
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
const nickRegExp = /(?:\x03[0-9]{1,2}(?:,[0-9]{1,2})?)?([\w[\]\\`^{|}-]+)/g;
|
const nickRegExp = /(?:\x03[0-9]{1,2}(?:,[0-9]{1,2})?)?([\w[\]\\`^{|}-]+)/g;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Chan from "../../models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
export default <IrcEventHandler>function (irc, network) {
|
export default <IrcEventHandler>function (irc, network) {
|
||||||
const client = this;
|
const client = this;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Network from "models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
import type {Database} from "sqlite3";
|
||||||
|
|
||||||
import log from "../../log";
|
import log from "../../log";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import Config from "../../config";
|
import Config from "../../config";
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
import type {Database} from "sqlite3";
|
import Client from "../../client";
|
||||||
import Client from "client";
|
import Chan from "../../models/chan";
|
||||||
import Chan from "models/chan";
|
import type {SqliteMessageStorage as ISqliteMessageStorage} from "../../types/plugins/messageStorage";
|
||||||
|
|
||||||
let sqlite3;
|
// TODO; type
|
||||||
|
let sqlite3: any;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sqlite3 = require("sqlite3");
|
sqlite3 = require("sqlite3");
|
||||||
|
@ -31,7 +34,7 @@ const schema = [
|
||||||
"CREATE INDEX IF NOT EXISTS time ON messages (time)",
|
"CREATE INDEX IF NOT EXISTS time ON messages (time)",
|
||||||
];
|
];
|
||||||
|
|
||||||
class SqliteMessageStorage implements SqliteMessageStorage {
|
class SqliteMessageStorage implements ISqliteMessageStorage {
|
||||||
client: Client;
|
client: Client;
|
||||||
isEnabled: boolean;
|
isEnabled: boolean;
|
||||||
database!: Database;
|
database!: Database;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import log from "../../log";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import filenamify from "filenamify";
|
import filenamify from "filenamify";
|
||||||
|
|
||||||
|
import log from "../../log";
|
||||||
import Config from "../../config";
|
import Config from "../../config";
|
||||||
import Msg from "../../models/msg";
|
import {MessageStorage} from "../../types/plugins/messageStorage";
|
||||||
import {MessageStorage} from "types/plugins/messageStorage";
|
import Client from "../../client";
|
||||||
import Client from "client";
|
|
||||||
|
|
||||||
class TextFileMessageStorage implements MessageStorage {
|
class TextFileMessageStorage implements MessageStorage {
|
||||||
client: Client;
|
client: Client;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Client from "client";
|
import Client from "../../client";
|
||||||
import Chan from "models/chan";
|
import Chan from "../../models/chan";
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
|
|
||||||
export default class PublicClient {
|
export default class PublicClient {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import log from "../log";
|
import log from "../log";
|
||||||
import Config from "../config";
|
import Config from "../config";
|
||||||
import type {PolicyMap, PolicyOption} from "types/plugins/sts";
|
import type {PolicyMap, PolicyOption} from "../types/plugins/sts";
|
||||||
|
|
||||||
class STSPolicies {
|
class STSPolicies {
|
||||||
stsFile: string;
|
stsFile: string;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import WebPushAPI from "web-push";
|
import WebPushAPI from "web-push";
|
||||||
import Config from "../config";
|
import Config from "../config";
|
||||||
import Client from "client";
|
import Client from "../client";
|
||||||
import * as os from "os";
|
import * as os from "os";
|
||||||
class WebPush {
|
class WebPush {
|
||||||
vapidKeys?: {
|
vapidKeys?: {
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import log from "./log";
|
import {Server as wsServer} from "ws";
|
||||||
import pkg from "../package.json";
|
|
||||||
import Client from "./client";
|
|
||||||
import ClientManager from "./clientManager";
|
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import {Server, Socket} from "socket.io";
|
import {Server, Socket} from "socket.io";
|
||||||
import dns from "dns";
|
import dns from "dns";
|
||||||
|
import colors from "chalk";
|
||||||
|
import net from "net";
|
||||||
|
|
||||||
|
import log from "./log";
|
||||||
|
import pkg from "../package.json";
|
||||||
|
import Client from "./client";
|
||||||
|
import ClientManager from "./clientManager";
|
||||||
import Uploader from "./plugins/uploader";
|
import Uploader from "./plugins/uploader";
|
||||||
import Helper from "./helper";
|
import Helper from "./helper";
|
||||||
import Config from "./config";
|
import Config from "./config";
|
||||||
import colors from "chalk";
|
|
||||||
import net from "net";
|
|
||||||
import Identification from "./identification";
|
import Identification from "./identification";
|
||||||
import changelog from "./plugins/changelog";
|
import changelog from "./plugins/changelog";
|
||||||
import inputs from "./plugins/inputs";
|
import inputs from "./plugins/inputs";
|
||||||
|
@ -24,15 +26,14 @@ import themes from "./plugins/packages/themes";
|
||||||
themes.loadLocalThemes();
|
themes.loadLocalThemes();
|
||||||
|
|
||||||
import packages from "./plugins/packages/index";
|
import packages from "./plugins/packages/index";
|
||||||
import {
|
import type {
|
||||||
ClientConfiguration,
|
ClientConfiguration,
|
||||||
Defaults,
|
Defaults,
|
||||||
IndexTemplateConfiguration,
|
IndexTemplateConfiguration,
|
||||||
ServerConfiguration,
|
ServerConfiguration,
|
||||||
} from "./types/config";
|
} from "./types/config";
|
||||||
|
|
||||||
import {Server as wsServer} from "ws";
|
import type {ServerOptions} from "./types/server";
|
||||||
import {ServerOptions} from "types/server";
|
|
||||||
|
|
||||||
// A random number that will force clients to reload the page if it differs
|
// A random number that will force clients to reload the page if it differs
|
||||||
const serverHash = Math.floor(Date.now() * Math.random());
|
const serverHash = Math.floor(Date.now() * Math.random());
|
||||||
|
@ -699,7 +700,13 @@ function initializeClient(
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("mute:change", ({target, setMutedTo}) => {
|
socket.on("mute:change", ({target, setMutedTo}) => {
|
||||||
const {chan, network} = client.find(target);
|
const networkAndChan = client.find(target);
|
||||||
|
|
||||||
|
if (!networkAndChan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {chan, network} = networkAndChan;
|
||||||
|
|
||||||
// If the user mutes the lobby, we mute the entire network.
|
// If the user mutes the lobby, we mute the entire network.
|
||||||
if (chan.type === ChanType.LOBBY) {
|
if (chan.type === ChanType.LOBBY) {
|
||||||
|
@ -756,7 +763,7 @@ function initializeClient(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.join(client.id);
|
socket.join(client.id?.toString());
|
||||||
|
|
||||||
const sendInitEvent = (tokenToSend) => {
|
const sendInitEvent = (tokenToSend) => {
|
||||||
socket.emit("init", {
|
socket.emit("init", {
|
||||||
|
@ -844,7 +851,7 @@ function performAuthentication(this: Socket, data) {
|
||||||
|
|
||||||
const socket = this;
|
const socket = this;
|
||||||
let client;
|
let client;
|
||||||
let token = null;
|
let token: string;
|
||||||
|
|
||||||
const finalInit = () =>
|
const finalInit = () =>
|
||||||
initializeClient(socket, client, token, data.lastMessage || -1, data.openChannel);
|
initializeClient(socket, client, token, data.lastMessage || -1, data.openChannel);
|
||||||
|
|
|
@ -6,11 +6,15 @@
|
||||||
"../client/js/helpers/ircmessageparser/findLinks.ts",
|
"../client/js/helpers/ircmessageparser/findLinks.ts",
|
||||||
"../client/js/helpers/ircmessageparser/cleanIrcMessage.ts"
|
"../client/js/helpers/ircmessageparser/cleanIrcMessage.ts"
|
||||||
],
|
],
|
||||||
|
// TODO: these should be imported from the base config,
|
||||||
|
// but ts-node doesn't seem to care.
|
||||||
"include": ["**/*"],
|
"include": ["**/*"],
|
||||||
|
"typeRoots": ["./src/types/"],
|
||||||
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"noImplicitAny": false
|
"noImplicitAny": false
|
||||||
},
|
}
|
||||||
"references": [{"path": "../"}]
|
// "references": [{"path": "../"}]
|
||||||
}
|
}
|
||||||
|
|
4
src/types/plugins/auth/index.d.ts
vendored
4
src/types/plugins/auth/index.d.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
import Client from "client";
|
import Client from "../../client";
|
||||||
import ClientManager from "clientManager";
|
import ClientManager from "../../clientManager";
|
||||||
|
|
||||||
type AuthHandler = (
|
type AuthHandler = (
|
||||||
manager: ClientManager,
|
manager: ClientManager,
|
||||||
|
|
2
src/types/plugins/inputs/index.d.ts
vendored
2
src/types/plugins/inputs/index.d.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import Client from "client";
|
import Client from "../../../client";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
type PluginInputHandler = (
|
type PluginInputHandler = (
|
||||||
|
|
2
src/types/plugins/irc-events/index.d.ts
vendored
2
src/types/plugins/irc-events/index.d.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import Client from "client";
|
import Client from "../../client";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
type IrcEventHandler = (
|
type IrcEventHandler = (
|
||||||
|
|
9
src/types/plugins/messageStorage/index.d.ts
vendored
9
src/types/plugins/messageStorage/index.d.ts
vendored
|
@ -1,8 +1,9 @@
|
||||||
|
import type {Database} from "sqlite3";
|
||||||
|
|
||||||
import {Channel} from "../../models/channel";
|
import {Channel} from "../../models/channel";
|
||||||
import {Message} from "../../models/message";
|
import {Message} from "../../models/message";
|
||||||
import {Network} from "../../models/network";
|
import {Network} from "../../models/network";
|
||||||
import sqlite from "sqlite3";
|
import Client from "../../client";
|
||||||
import Client from "client";
|
|
||||||
|
|
||||||
interface MessageStorage {
|
interface MessageStorage {
|
||||||
client: Client;
|
client: Client;
|
||||||
|
@ -21,6 +22,6 @@ interface MessageStorage {
|
||||||
canProvideMessages(): boolean;
|
canProvideMessages(): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SqliteMessageStorage extends MessageStorage {
|
export interface SqliteMessageStorage extends MessageStorage {
|
||||||
database: sqlite.Database;
|
database: Database;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.base.json",
|
||||||
"files": ["./webpack.config.ts", "./babel.config.cjs", "./src/helper.ts"],
|
"files": ["index.ts", "./src/index.d.ts", "./webpack.config.ts", "./src/helper.ts"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
@ -8,7 +8,11 @@
|
||||||
"@client/*": ["client/*"]
|
"@client/*": ["client/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ts-node": {
|
||||||
|
"files": true
|
||||||
|
},
|
||||||
"exclude": ["./node_modules"],
|
"exclude": ["./node_modules"],
|
||||||
|
"include": ["./src/**/*"],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./src"
|
"path": "./src"
|
||||||
|
|
Loading…
Reference in a new issue