can only be run on Framework fix

This commit is contained in:
choco
2025-10-11 22:54:04 +02:00
parent ba16963b66
commit 3936cbd439
2 changed files with 3 additions and 4 deletions

View File

@@ -187,7 +187,7 @@ public sealed class PairRequestService : DisposableMediatorSubscriberBase
return _requests.RemoveAll(r => now - r.ReceivedAt > Expiration) > 0; return _requests.RemoveAll(r => now - r.ReceivedAt > Expiration) > 0;
} }
public void AcceptPairRequest(string hashedCid) public void AcceptPairRequest(string hashedCid, string displayName)
{ {
_ = Task.Run(async () => _ = Task.Run(async () =>
{ {
@@ -196,8 +196,7 @@ public sealed class PairRequestService : DisposableMediatorSubscriberBase
await _apiController.Value.TryPairWithContentId(hashedCid).ConfigureAwait(false); await _apiController.Value.TryPairWithContentId(hashedCid).ConfigureAwait(false);
RemoveRequest(hashedCid); RemoveRequest(hashedCid);
var display = ResolveDisplayName(hashedCid); var displayText = string.IsNullOrEmpty(displayName) ? hashedCid : displayName;
var displayText = string.IsNullOrEmpty(display) ? hashedCid : display;
Mediator.Publish(new NotificationMessage( Mediator.Publish(new NotificationMessage(
"Pair request accepted", "Pair request accepted",
$"Sent a pair request back to {displayText}.", $"Sent a pair request back to {displayText}.",

View File

@@ -116,7 +116,7 @@ public partial class ApiController
_lightlessNotificationService.ShowPairRequestNotification( _lightlessNotificationService.ShowPairRequestNotification(
senderName, senderName,
request.HashedCid, request.HashedCid,
onAccept: () => _pairRequestService.AcceptPairRequest(request.HashedCid), onAccept: () => _pairRequestService.AcceptPairRequest(request.HashedCid, senderName),
onDecline: () => _pairRequestService.DeclinePairRequest(request.HashedCid)); onDecline: () => _pairRequestService.DeclinePairRequest(request.HashedCid));
return Task.CompletedTask; return Task.CompletedTask;