2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 16:33:43 -04:00

[Herald+Core] Send notifications to plugins during read-all in Debug (#136)

This will allow notifications to be sent to Notification listeners during read-all to enhance testability.

This is controlled by the `DEBUG` compiler directive, so Release versions will not have this behaviour.

However, Herald, being a plugin itself, should ignore these otherwise the results are.... unfortunate. #askmehowiknow
This commit is contained in:
F K
2024-01-29 15:36:03 -05:00
committed by GitHub
parent ad1df66379
commit a555c86083
2 changed files with 15 additions and 0 deletions

View File

@ -6,6 +6,8 @@ namespace Observatory.Herald
{
public class HeraldNotifier : IObservatoryNotifier
{
private IObservatoryCore Core;
public HeraldNotifier()
{
heraldSettings = DefaultSettings;
@ -53,8 +55,10 @@ namespace Observatory.Herald
}
}
}
public void Load(IObservatoryCore observatoryCore)
{
Core = observatoryCore;
var speechManager = new SpeechRequestManager(
heraldSettings, observatoryCore.HttpClient, observatoryCore.PluginStorageFolder, observatoryCore.GetPluginErrorLogger(this));
heraldSpeech = new HeraldQueue(speechManager, observatoryCore.GetPluginErrorLogger(this), observatoryCore);
@ -77,6 +81,8 @@ namespace Observatory.Herald
public void OnNotificationEvent(NotificationArgs notificationEventArgs)
{
if (Core.IsLogMonitorBatchReading) return;
if (heraldSettings.Enabled && notificationEventArgs.Rendering.HasFlag(NotificationRendering.NativeVocal))
heraldSpeech.Enqueue(
notificationEventArgs,