Implement NostrNetworkManager and UserRelayListManager
This commit implements a new layer called NostrNetworkManager, responsible for managing interactions with the Nostr network, and providing a higher level API that is easier and more secure to use for the layer above it. It also integrates it with the rest of the app, by moving RelayPool and PostBox into NostrNetworkManager, along with all their usages. Changelog-Added: Added NIP-65 relay list support Changelog-Changed: Improved robustness of relay list handling Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -163,7 +163,7 @@ struct ShareExtensionView: View {
|
||||
break
|
||||
case .active:
|
||||
print("txn: 📙 HIGHLIGHTER ACTIVE")
|
||||
state.pool.ping()
|
||||
state.nostrNetwork.pool.ping()
|
||||
@unknown default:
|
||||
break
|
||||
}
|
||||
@@ -238,7 +238,7 @@ struct ShareExtensionView: View {
|
||||
self.highlighter_state = .failed(error: "Cannot convert post data into a nostr event")
|
||||
return
|
||||
}
|
||||
state.postbox.send(posted_event, on_flush: .once({ flushed_event in
|
||||
state.nostrNetwork.postbox.send(posted_event, on_flush: .once({ flushed_event in
|
||||
if flushed_event.event.id == posted_event.id {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: { // Offset labor perception bias
|
||||
self.highlighter_state = .posted(event: flushed_event.event)
|
||||
|
||||
Reference in New Issue
Block a user