diff --git a/Lagrange.Core/Internal/Context/ContextCollection.cs b/Lagrange.Core/Internal/Context/ContextCollection.cs index 5f07c03bd..a0ce291ec 100644 --- a/Lagrange.Core/Internal/Context/ContextCollection.cs +++ b/Lagrange.Core/Internal/Context/ContextCollection.cs @@ -16,7 +16,6 @@ internal class ContextCollection public BotKeystore Keystore { get; } public BotAppInfo AppInfo { get; } public BotDeviceInfo Device { get; } - public BotConfig Config { get; } public TaskScheduler Scheduler { get; } public EventInvoker Invoker { get; } @@ -24,14 +23,13 @@ internal class ContextCollection public ContextCollection(BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device, BotConfig config, EventInvoker invoker, TaskScheduler scheduler) { - Packet = new PacketContext(this, keystore, appInfo, device); + Packet = new PacketContext(this, keystore, appInfo, device, config); Socket = new SocketContext(this, keystore, appInfo, device, config); Service = new ServiceContext(this, keystore, appInfo, device); Business = new BusinessContext(this, keystore, appInfo, device); Log = new LogContext(this, keystore, appInfo, device, invoker); Highway = new HighwayContext(this, keystore, appInfo, device); - Config = config; Keystore = keystore; AppInfo = appInfo; Device = device; diff --git a/Lagrange.Core/Internal/Context/PacketContext.cs b/Lagrange.Core/Internal/Context/PacketContext.cs index 9014f8d52..f94b4de64 100644 --- a/Lagrange.Core/Internal/Context/PacketContext.cs +++ b/Lagrange.Core/Internal/Context/PacketContext.cs @@ -19,10 +19,10 @@ internal class PacketContext : ContextBase private readonly ConcurrentDictionary> _pendingTasks; - public PacketContext(ContextCollection collection, BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device) + public PacketContext(ContextCollection collection, BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device, BotConfig config) : base(collection, keystore, appInfo, device) { - _signProvider = Collection.Config.CustomSignProvider ?? appInfo.Os switch + _signProvider = config.CustomSignProvider ?? appInfo.Os switch { "Windows" => new WindowsSigner(), "Mac" => new MacSigner(),