From abde23e8761f5226db7262814d82d35947c4e63a Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sat, 16 Apr 2022 08:28:51 -0700 Subject: [PATCH] add_relay helper this adds local relay profiles Signed-off-by: William Casarin --- damus/ContentView.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/damus/ContentView.swift b/damus/ContentView.swift index dc6cc8a3..c0e4483c 100644 --- a/damus/ContentView.swift +++ b/damus/ContentView.swift @@ -118,12 +118,22 @@ struct ContentView: View { self.timeline = timeline } + func add_relay(_ pool: RelayPool, _ relay: String) { + //add_rw_relay(pool, "wss://nostr-pub.wellorder.net") + add_rw_relay(pool, "wss://\(relay)") + let profile = Profile(name: relay, about: nil, picture: nil) + let ts = Int64(Date().timeIntervalSince1970) + let tsprofile = TimestampedProfile(profile: profile, timestamp: ts) + self.profiles["wss://\(relay)"] = tsprofile + } + func connect() { let pool = RelayPool(handle_event: handle_event) - add_rw_relay(pool, "wss://nostr-pub.wellorder.net") - add_rw_relay(pool, "wss://nostr-relay.wlvs.space") - add_rw_relay(pool, "wss://nostr.bitcoiner.social") + add_relay(pool, "nostr-relay.wlvs.space") + add_relay(pool, "nostr.bitcoiner.social") + add_relay(pool, "nostr-relay.freeberty.net") + add_relay(pool, "nostr-relay.untethr.me") self.pool = pool pool.connect()