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:
@ -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,
|
||||
|
Reference in New Issue
Block a user