damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | LICENSE

commit abde23e8761f5226db7262814d82d35947c4e63a
parent a2b86872bd048173f134c0c46a96f5c867c6b2a0
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 16 Apr 2022 08:28:51 -0700

add_relay helper

this adds local relay profiles

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/ContentView.swift | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 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()