Also broadcast event's user profile

This should help propagation of user profiles

Changelog-Changed: Broadcast now also broadcasts event user's profile
This commit is contained in:
William Casarin
2023-04-03 09:47:15 -07:00
parent c9c51c6d4a
commit cc190c3618
4 changed files with 11 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ var BOOTSTRAP_RELAYS = [
struct TimestampedProfile {
let profile: Profile
let timestamp: Int64
let event: NostrEvent
}
enum Sheets: Identifiable {
@@ -382,7 +383,13 @@ struct ContentView: View {
}
.onReceive(handle_notify(.broadcast_event)) { obj in
let ev = obj.object as! NostrEvent
self.damus_state?.pool.send(.event(ev))
guard let ds = self.damus_state else {
return
}
ds.postbox.send(ev)
if let profile = ds.profiles.profiles[ev.pubkey] {
ds.postbox.send(profile.event)
}
}
.onReceive(handle_notify(.unfollow)) { notif in
guard let privkey = self.privkey else {