Import upstream patches from The Lounge (Feb 2024), bump version to v4.4.1-2 #2

Merged
hgw merged 18 commits from upstream-patches-202402 into master 2024-02-02 03:41:49 +00:00
Showing only changes of commit 80c378961a - Show all commits

View File

@ -18,6 +18,7 @@ import TextFileMessageStorage from "./plugins/messageStorage/text";
import Network, {IgnoreListItem, NetworkConfig, NetworkWithIrcFramework} from "./models/network"; import Network, {IgnoreListItem, NetworkConfig, NetworkWithIrcFramework} from "./models/network";
import ClientManager from "./clientManager"; import ClientManager from "./clientManager";
import {MessageStorage, SearchQuery, SearchResponse} from "./plugins/messageStorage/types"; import {MessageStorage, SearchQuery, SearchResponse} from "./plugins/messageStorage/types";
import { StorageCleaner } from "./storageCleaner";
type OrderItem = Chan["id"] | Network["uuid"]; type OrderItem = Chan["id"] | Network["uuid"];
type Order = OrderItem[]; type Order = OrderItem[];
@ -138,6 +139,13 @@ class Client {
if (!Config.values.public && client.config.log) { if (!Config.values.public && client.config.log) {
if (Config.values.messageStorage.includes("sqlite")) { if (Config.values.messageStorage.includes("sqlite")) {
client.messageProvider = new SqliteMessageStorage(client.name); client.messageProvider = new SqliteMessageStorage(client.name);
if (Config.values.storagePolicy.enabled) {
log.info(
`Activating storage cleaner. Policy: ${Config.values.storagePolicy.deletionPolicy}. MaxAge: ${Config.values.storagePolicy.maxAgeDays} days`
);
const cleaner = new StorageCleaner(client.messageProvider);
cleaner.start();
}
client.messageStorage.push(client.messageProvider); client.messageStorage.push(client.messageProvider);
} }