add NotificationService, cleanup

This commit is contained in:
Stanley Dimant
2023-01-31 14:43:22 +01:00
parent 12f0789e9c
commit 576d005b32
17 changed files with 243 additions and 84 deletions

View File

@@ -1,7 +1,9 @@
using MareSynchronos.API.Data.Enum;
using Dalamud.Interface.Internal.Notifications;
using MareSynchronos.API.Data.Enum;
using MareSynchronos.API.Dto;
using MareSynchronos.API.Dto.Group;
using MareSynchronos.API.Dto.User;
using MareSynchronos.Mediator;
using MareSynchronos.Utils;
using Microsoft.AspNetCore.SignalR.Client;
@@ -253,19 +255,13 @@ public partial class ApiController
switch (severity)
{
case MessageSeverity.Error:
Logger.Error(message);
_dalamudUtil.PrintErrorChat(message);
_mediator.Publish(new NotificationMessage("Warning from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Error, 7500));
break;
case MessageSeverity.Warning:
Logger.Warn(message);
_dalamudUtil.PrintWarnChat(message);
_mediator.Publish(new NotificationMessage("Warning from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Warning, 7500));
break;
case MessageSeverity.Information:
Logger.Info(message);
if (!_configService.Current.HideInfoMessages)
{
_dalamudUtil.PrintInfoChat(message);
}
_mediator.Publish(new NotificationMessage("Info from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Info, 5000));
break;
}