diff --git a/HellionChat/MessageManager.cs b/HellionChat/MessageManager.cs index 7d74ede..d50000d 100644 --- a/HellionChat/MessageManager.cs +++ b/HellionChat/MessageManager.cs @@ -52,7 +52,7 @@ internal class MessageManager : IAsyncDisposable { Plugin = plugin; - Store = new MessageStore(DatabasePath()); + Store = new MessageStore(DatabasePath(), Plugin.PlatformUtil); PendingMessageThread = new Thread(() => ProcessPendingMessages(PendingThreadCancellationToken.Token) diff --git a/HellionChat/MessageStore.cs b/HellionChat/MessageStore.cs index ae4f213..b200c5f 100644 --- a/HellionChat/MessageStore.cs +++ b/HellionChat/MessageStore.cs @@ -9,7 +9,6 @@ using MessagePack; using MessagePack.Formatters; using MessagePack.Resolvers; using Microsoft.Data.Sqlite; -using DalamudUtil = Dalamud.Utility.Util; using Encoding = System.Text.Encoding; namespace HellionChat; @@ -137,9 +136,12 @@ internal class MessageStore : IDisposable ) ); - internal MessageStore(string dbPath) + private readonly IPlatformUtil _platformUtil; + + internal MessageStore(string dbPath, IPlatformUtil platformUtil) { DbPath = dbPath; + _platformUtil = platformUtil; Connection = Connect(); Migrate(); } @@ -166,7 +168,7 @@ internal class MessageStore : IDisposable conn.Open(); conn.Execute(@"PRAGMA journal_mode=WAL;"); conn.Execute(@"PRAGMA synchronous=NORMAL;"); - if (DalamudUtil.IsWine()) + if (_platformUtil.IsWine) conn.Execute(@"PRAGMA cache_size = 32768;"); return conn; }