feat(desktop): add DM broadcast status banner and audit fixes
- Show relay confirmation URLs in broadcast banner - Add relayUrls field to DmBroadcastStatus.Sent - Wire send progress tracking with per-relay confirmations - Fix empty chatroom Loading state transition - Improve NewDmDialog npub metadata resolution - Harden sendAndWaitForResponse timeout handling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -45,7 +45,18 @@ suspend fun INostrClient.sendAndWaitForResponse(
|
||||
event: Event,
|
||||
relayList: Set<NormalizedRelayUrl>,
|
||||
timeoutInSeconds: Long = 15,
|
||||
): Boolean {
|
||||
): Boolean = sendAndWaitForResponseDetailed(event, relayList, timeoutInSeconds).any { it.value }
|
||||
|
||||
/**
|
||||
* Sends an event to the given relays and waits for OK responses.
|
||||
* Returns per-relay results: relay URL -> accepted (true/false).
|
||||
*/
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
suspend fun INostrClient.sendAndWaitForResponseDetailed(
|
||||
event: Event,
|
||||
relayList: Set<NormalizedRelayUrl>,
|
||||
timeoutInSeconds: Long = 15,
|
||||
): Map<NormalizedRelayUrl, Boolean> {
|
||||
val resultChannel = Channel<Result>(UNLIMITED)
|
||||
|
||||
Log.d("sendAndWaitForResponse", "Waiting for ${relayList.size} responses")
|
||||
@@ -124,5 +135,5 @@ suspend fun INostrClient.sendAndWaitForResponse(
|
||||
|
||||
Log.d("sendAndWaitForResponse", "Finished with ${receivedResults.size} results")
|
||||
|
||||
return receivedResults.any { it.value }
|
||||
return receivedResults
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user