notifications improvement, working pairs incoming request feature and working user logging in notif

This commit is contained in:
choco
2025-10-06 20:25:47 +02:00
parent 090b81c989
commit 83e4555e4b
7 changed files with 176 additions and 49 deletions

View File

@@ -25,6 +25,7 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
private readonly LightlessConfigService _configurationService;
private readonly IContextMenu _dalamudContextMenu;
private readonly PairFactory _pairFactory;
private readonly LightlessNotificationService _lightlessNotificationService;
private Lazy<List<Pair>> _directPairsInternal;
private Lazy<Dictionary<GroupFullInfoDto, List<Pair>>> _groupPairsInternal;
private Lazy<Dictionary<Pair, List<GroupFullInfoDto>>> _pairsWithGroupsInternal;
@@ -35,12 +36,14 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
public PairManager(ILogger<PairManager> logger, PairFactory pairFactory,
LightlessConfigService configurationService, LightlessMediator mediator,
IContextMenu dalamudContextMenu, PairProcessingLimiter pairProcessingLimiter) : base(logger, mediator)
IContextMenu dalamudContextMenu, PairProcessingLimiter pairProcessingLimiter,
LightlessNotificationService lightlessNotificationService) : base(logger, mediator)
{
_pairFactory = pairFactory;
_configurationService = configurationService;
_dalamudContextMenu = dalamudContextMenu;
_pairProcessingLimiter = pairProcessingLimiter;
_lightlessNotificationService = lightlessNotificationService;
Mediator.Subscribe<DisconnectedMessage>(this, (_) => ClearPairs());
Mediator.Subscribe<CutsceneEndMessage>(this, (_) => ReapplyPairData());
_directPairsInternal = DirectPairsLazy();
@@ -168,7 +171,7 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
var msg = !string.IsNullOrEmpty(note)
? $"{note} ({pair.UserData.AliasOrUID}) is now online"
: $"{pair.UserData.AliasOrUID} is now online";
Mediator.Publish(new NotificationMessage("User online", msg, NotificationType.Info, TimeSpan.FromSeconds(5)));
_lightlessNotificationService.ShowNotification("User Online", msg, NotificationType.Info, TimeSpan.FromSeconds(5));
}
QueuePairCreation(pair, dto);