api cleanup, decline message on notification decline
This commit is contained in:
@@ -568,7 +568,7 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
|
||||
senderName,
|
||||
request.HashedCid,
|
||||
onAccept: () => _pairRequestService.AcceptPairRequest(request.HashedCid, senderName),
|
||||
onDecline: () => _pairRequestService.DeclinePairRequest(request.HashedCid));
|
||||
onDecline: () => _pairRequestService.DeclinePairRequest(request.HashedCid, senderName));
|
||||
}
|
||||
|
||||
private void HandlePairRequestsUpdated(PairRequestsUpdatedMessage _)
|
||||
|
||||
@@ -220,9 +220,13 @@ public sealed class PairRequestService : DisposableMediatorSubscriberBase
|
||||
});
|
||||
}
|
||||
|
||||
public void DeclinePairRequest(string hashedCid)
|
||||
public void DeclinePairRequest(string hashedCid, string displayName)
|
||||
{
|
||||
RemoveRequest(hashedCid);
|
||||
Mediator.Publish(new NotificationMessage("Pair request declined",
|
||||
"Declined " + displayName + "'s pending pair request.",
|
||||
NotificationType.Info,
|
||||
TimeSpan.FromSeconds(3)));
|
||||
Logger.LogDebug("Declined pair request from {HashedCid}", hashedCid);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IL
|
||||
private readonly ServerConfigurationManager _serverManager;
|
||||
private readonly TokenProvider _tokenProvider;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
private readonly NotificationService _lightlessNotificationService;
|
||||
private CancellationTokenSource _connectionCancellationTokenSource;
|
||||
private ConnectionDto? _connectionDto;
|
||||
private bool _doNotNotifyOnNextInfo = false;
|
||||
@@ -54,7 +53,6 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IL
|
||||
_serverManager = serverManager;
|
||||
_tokenProvider = tokenProvider;
|
||||
_lightlessConfigService = lightlessConfigService;
|
||||
_lightlessNotificationService = lightlessNotificationService;
|
||||
_connectionCancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
Mediator.Subscribe<DalamudLoginMessage>(this, (_) => DalamudUtilOnLogIn());
|
||||
|
||||
Reference in New Issue
Block a user