removed temp accept/decline logic from the api layer

This commit is contained in:
choco
2025-10-11 21:52:14 +02:00
parent 59d0e8ee37
commit bb779904f7
2 changed files with 44 additions and 29 deletions

View File

@@ -111,37 +111,13 @@ public partial class ApiController
return Task.CompletedTask;
var request = _pairRequestService.RegisterIncomingRequest(dto.myHashedCid, dto.message ?? string.Empty);
// Use the new interactive notification system for pair requests
var senderName = string.IsNullOrEmpty(request.DisplayName) ? "Unknown User" : request.DisplayName;
_lightlessNotificationService.ShowPairRequestNotification(
senderName,
request.HashedCid,
onAccept: () =>
{
// Fire and forget async operation
_ = Task.Run(async () =>
{
var myCidHash = (await _dalamudUtil.GetCIDAsync().ConfigureAwait(false)).ToString().GetHash256();
try
{
await TryPairWithContentId(request.HashedCid, myCidHash).ConfigureAwait(false);
_pairRequestService.RemoveRequest(request.HashedCid);
}
catch (Exception ex)
{
Mediator.Publish(new NotificationMessage(
"Failed to Accept Pair Request",
ex.Message,
NotificationType.Error,
TimeSpan.FromSeconds(5)));
}
});
},
onDecline: () =>
{
_pairRequestService.RemoveRequest(request.HashedCid);
});
onAccept: () => _pairRequestService.AcceptPairRequest(request.HashedCid),
onDecline: () => _pairRequestService.DeclinePairRequest(request.HashedCid));
return Task.CompletedTask;
}