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:
@@ -54,7 +54,7 @@ enum CancelSendErr {
|
||||
}
|
||||
|
||||
class PostBox {
|
||||
let pool: RelayPool
|
||||
private let pool: RelayPool
|
||||
var events: [NoteId: PostedEvent]
|
||||
|
||||
init(pool: RelayPool) {
|
||||
|
||||
@@ -126,7 +126,7 @@ enum Route: Hashable {
|
||||
case .FollowersYouKnow(let friendedFollowers, let followers):
|
||||
FollowersYouKnowView(damus_state: damusState, friended_followers: friendedFollowers, followers: followers)
|
||||
case .Script(let load_model):
|
||||
LoadScript(pool: damusState.pool, model: load_model)
|
||||
LoadScript(pool: damusState.nostrNetwork.pool, model: load_model)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user