feat(services): add TellRouterService stub
Skeleton for the upcoming auto-open routing. Subscribes to ChatGui.ChatMessageUnhandled and Dispose unsubscribes — when the routing logic lands, it drops into OnChatMessage without touching the DI graph or Plugin.cs registration.
This commit is contained in:
@@ -112,6 +112,10 @@ internal static class PluginHostFactory
|
|||||||
sp.GetRequiredService<ILogger<Integrations.HonorificService>>(),
|
sp.GetRequiredService<ILogger<Integrations.HonorificService>>(),
|
||||||
sp.GetRequiredService<IFramework>()
|
sp.GetRequiredService<IFramework>()
|
||||||
));
|
));
|
||||||
|
services.AddSingleton(sp => new Services.TellRouterService(
|
||||||
|
sp.GetRequiredService<IChatGui>(),
|
||||||
|
sp.GetRequiredService<ILogger<Services.TellRouterService>>()
|
||||||
|
));
|
||||||
services.AddSingleton(sp => new Integrations.FailedTellNotifier(
|
services.AddSingleton(sp => new Integrations.FailedTellNotifier(
|
||||||
sp.GetRequiredService<ILogger<Integrations.FailedTellNotifier>>()
|
sp.GetRequiredService<ILogger<Integrations.FailedTellNotifier>>()
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using Dalamud.Game.Chat;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace HellionChat.Services;
|
||||||
|
|
||||||
|
// Skeleton for the upcoming auto-open routing layer. Subscribes to IChatGui
|
||||||
|
// up front so the DI graph and Plugin.cs registration stay frozen — when
|
||||||
|
// the routing logic lands, it drops into OnChatMessage without touching
|
||||||
|
// anything else.
|
||||||
|
internal sealed class TellRouterService : IDisposable
|
||||||
|
{
|
||||||
|
private readonly IChatGui _chatGui;
|
||||||
|
private readonly ILogger<TellRouterService> _logger;
|
||||||
|
|
||||||
|
public TellRouterService(IChatGui chatGui, ILogger<TellRouterService> logger)
|
||||||
|
{
|
||||||
|
_chatGui = chatGui;
|
||||||
|
_logger = logger;
|
||||||
|
_chatGui.ChatMessageUnhandled += OnChatMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_chatGui.ChatMessageUnhandled -= OnChatMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnChatMessage(IChatMessage message)
|
||||||
|
{
|
||||||
|
// Intentional no-op until the routing implementation lands.
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user