textStorage: rip out client instance
We don't need the client, so there's no need to accept it.
This commit is contained in:
parent
661d5cb5b0
commit
52b8a2a78e
@ -143,7 +143,7 @@ class Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Config.values.messageStorage.includes("text")) {
|
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) {
|
for (const messageStorage of client.messageStorage) {
|
||||||
|
@ -5,17 +5,16 @@ import filenamify from "filenamify";
|
|||||||
|
|
||||||
import Config from "../../config";
|
import Config from "../../config";
|
||||||
import {MessageStorage} from "./types";
|
import {MessageStorage} from "./types";
|
||||||
import Client from "../../client";
|
|
||||||
import Channel from "../../models/chan";
|
import Channel from "../../models/chan";
|
||||||
import {Message, MessageType} from "../../models/msg";
|
import {Message, MessageType} from "../../models/msg";
|
||||||
import Network from "../../models/network";
|
import Network from "../../models/network";
|
||||||
|
|
||||||
class TextFileMessageStorage implements MessageStorage {
|
class TextFileMessageStorage implements MessageStorage {
|
||||||
client: Client;
|
|
||||||
isEnabled: boolean;
|
isEnabled: boolean;
|
||||||
|
username: string;
|
||||||
|
|
||||||
constructor(client: Client) {
|
constructor(username: string) {
|
||||||
this.client = client;
|
this.username = username;
|
||||||
this.isEnabled = false;
|
this.isEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ class TextFileMessageStorage implements MessageStorage {
|
|||||||
|
|
||||||
const logPath = path.join(
|
const logPath = path.join(
|
||||||
Config.getUserLogsPath(),
|
Config.getUserLogsPath(),
|
||||||
this.client.name,
|
this.username,
|
||||||
TextFileMessageStorage.getNetworkFolderName(network)
|
TextFileMessageStorage.getNetworkFolderName(network)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user