This commit is contained in:
Max Leiter 2022-05-31 12:54:21 -07:00
parent cff9209a25
commit 21b52a99a0
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
11 changed files with 25 additions and 15 deletions

View file

@ -53,6 +53,7 @@ export default defineComponent({
const hover = () => {
if (props.onHover) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return props.onHover(props.user as UserInMessage);
}

View file

@ -2,9 +2,9 @@ import socket from "../socket";
import {store} from "../store";
function input() {
const messageIds = [];
const messageIds: number[] = [];
for (const message of store.state.activeChannel?.channel.messages) {
for (const message of store.state.activeChannel.channel.messages) {
let toggled = false;
for (const preview of message.previews) {

View file

@ -1,5 +1,4 @@
const matchFormatting =
// eslint-disable-next-line no-control-regex
/\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
export default (message: string) => message.replace(matchFormatting, "").trim();

View file

@ -1,6 +1,10 @@
import LinkifyIt, {Match} from "linkify-it";
import {Part} from "./merge";
export type LinkPart = Part & {
link: string;
};
type OurMatch = Match & {
noschema?: boolean;
};
@ -78,8 +82,4 @@ function returnUrl(url: OurMatch): LinkPart {
};
}
export type LinkPart = Part & {
link: string;
};
export {findLinks, findLinksWithSchema};

View file

@ -1,22 +1,22 @@
import socket from "../socket";
import {store} from "../store";
socket.on("setting:new", function (data) {
socket.on("setting:new", async function (data) {
const name = data.name;
const value = data.value;
store.dispatch("settings/update", {name, value, sync: false});
await store.dispatch("settings/update", {name, value, sync: false});
});
socket.on("setting:all", function (settings) {
socket.on("setting:all", async function (settings) {
const serverHasSettings = Object.keys(settings).length > 0;
store.commit("serverHasSettings", serverHasSettings);
if (serverHasSettings) {
for (const name in settings) {
store.dispatch("settings/update", {name, value: settings[name], sync: false});
await store.dispatch("settings/update", {name, value: settings[name], sync: false});
}
} else {
store.dispatch("settings/syncAll");
await store.dispatch("settings/syncAll");
}
});

View file

@ -15,7 +15,9 @@ program
.action(function (options) {
initalizeConfig();
const server = require("../server");
const newLocal = "../server";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const server = require(newLocal);
server.default(options);
});

View file

@ -19,6 +19,7 @@ program
return;
}
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ClientManager = require("../../clientManager");
const manager = new ClientManager();
const users = manager.getUsers();

View file

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import fs from "fs";
import path from "path";
import filenamify from "filenamify";
@ -162,7 +163,7 @@ class TextFileMessageStorage implements MessageStorage {
export default TextFileMessageStorage;
function cleanFilename(name) {
function cleanFilename(name: string) {
name = filenamify(name, {replacement: "_"});
name = name.toLowerCase();

View file

@ -1,4 +1,6 @@
// @ts-nocheck
// @eslint-disable
// https://raw.githubusercontent.com/eternagame/HTML-Chat/vue-rewrite/src/app/types/modules/irc-framework/irc-framework.d.ts
// TODO: Fix this
declare module "irc-framework" {

View file

@ -36,6 +36,10 @@ interface ServerToClientEvents {
"mentions:list": (data: Mention[]) => void;
"setting:new": ({name: string, value: any}) => void;
"setting:all": (settings: {[key: string]: any}) => void;
more: ({
chan,
messages,

View file

@ -3,6 +3,6 @@
"host": "irc.example.com",
"port": 7000,
"duration": 3600,
"expires": 1654029411770
"expires": 1654030206992
}
]