textStorage: rip out client instance

We don't need the client, so there's no need to accept it.
This commit is contained in:
Reto Brunner 2022-12-30 16:16:22 +01:00
parent 661d5cb5b0
commit 52b8a2a78e
2 changed files with 5 additions and 6 deletions

View file

@ -143,7 +143,7 @@ class Client {
}
if (Config.values.messageStorage.includes("text")) {
client.messageStorage.push(new TextFileMessageStorage(client));
client.messageStorage.push(new TextFileMessageStorage(client.name));
}
for (const messageStorage of client.messageStorage) {

View file

@ -5,17 +5,16 @@ import filenamify from "filenamify";
import Config from "../../config";
import {MessageStorage} from "./types";
import Client from "../../client";
import Channel from "../../models/chan";
import {Message, MessageType} from "../../models/msg";
import Network from "../../models/network";
class TextFileMessageStorage implements MessageStorage {
client: Client;
isEnabled: boolean;
username: string;
constructor(client: Client) {
this.client = client;
constructor(username: string) {
this.username = username;
this.isEnabled = false;
}
@ -36,7 +35,7 @@ class TextFileMessageStorage implements MessageStorage {
const logPath = path.join(
Config.getUserLogsPath(),
this.client.name,
this.username,
TextFileMessageStorage.getNetworkFolderName(network)
);