Browse Source

add_relay helper

this adds local relay profiles

Signed-off-by: William Casarin <jb55@jb55.com>
profiles-everywhere
William Casarin 3 years ago
parent
commit
abde23e876
  1. 16
      damus/ContentView.swift

16
damus/ContentView.swift

@ -118,12 +118,22 @@ struct ContentView: View {
self.timeline = timeline 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() { func connect() {
let pool = RelayPool(handle_event: handle_event) let pool = RelayPool(handle_event: handle_event)
add_rw_relay(pool, "wss://nostr-pub.wellorder.net") add_relay(pool, "nostr-relay.wlvs.space")
add_rw_relay(pool, "wss://nostr-relay.wlvs.space") add_relay(pool, "nostr.bitcoiner.social")
add_rw_relay(pool, "wss://nostr.bitcoiner.social") add_relay(pool, "nostr-relay.freeberty.net")
add_relay(pool, "nostr-relay.untethr.me")
self.pool = pool self.pool = pool
pool.connect() pool.connect()

Loading…
Cancel
Save