ndb: switch to nostrdb notes

This is a refactor of the codebase to use a more memory-efficient
representation of notes. It should also be much faster at decoding since
we're using a custom C json parser now.

Changelog-Changed: Improved memory usage and performance when processing events
This commit is contained in:
William Casarin
2023-07-26 08:46:44 -07:00
parent 55bbe8f855
commit cebd1f48ca
110 changed files with 2153 additions and 1799 deletions

View File

@@ -14,7 +14,7 @@ struct ThreadView: View {
@Environment(\.dismiss) var dismiss
var parent_events: [NostrEvent] {
state.events.parent_events(event: thread.event)
state.events.parent_events(event: thread.event, privkey: state.keypair.privkey)
}
var child_events: [NostrEvent] {
@@ -34,7 +34,7 @@ struct ThreadView: View {
selected: false)
.padding(.horizontal)
.onTapGesture {
thread.set_active_event(parent_event)
thread.set_active_event(parent_event, privkey: self.state.keypair.privkey)
scroll_to_event(scroller: reader, id: parent_event.id, delay: 0.1, animate: false)
}
@@ -77,7 +77,7 @@ struct ThreadView: View {
)
.padding(.horizontal)
.onTapGesture {
thread.set_active_event(child_event)
thread.set_active_event(child_event, privkey: state.keypair.privkey)
scroll_to_event(scroller: reader, id: child_event.id, delay: 0.1, animate: false)
}