search: switch to nostrdb profile searching

Changelog-Changed: Switch to nostrdb for @'s and user search
This commit is contained in:
William Casarin
2023-09-21 13:19:22 -04:00
parent fafe3b4b3e
commit 7a85ae29ca
11 changed files with 325 additions and 33 deletions

View File

@@ -31,7 +31,6 @@ struct DamusState {
let muted_threads: MutedThreadsManager
let wallet: WalletModel
let nav: NavigationCoordinator
let user_search_cache: UserSearchCache
let music: MusicController?
let video: VideoController
let ndb: Ndb
@@ -62,7 +61,6 @@ struct DamusState {
}
static var empty: DamusState {
let user_search_cache = UserSearchCache()
let empty_pub: Pubkey = .empty
let empty_sec: Privkey = .empty
let kp = Keypair(pubkey: empty_pub, privkey: nil)
@@ -73,7 +71,7 @@ struct DamusState {
likes: EventCounter(our_pubkey: empty_pub),
boosts: EventCounter(our_pubkey: empty_pub),
contacts: Contacts(our_pubkey: empty_pub),
profiles: Profiles(user_search_cache: user_search_cache, ndb: .empty),
profiles: Profiles(ndb: .empty),
dms: DirectMessagesModel(our_pubkey: empty_pub),
previews: PreviewCache(),
zaps: Zaps(our_pubkey: empty_pub),
@@ -90,7 +88,6 @@ struct DamusState {
muted_threads: MutedThreadsManager(keypair: kp),
wallet: WalletModel(settings: UserSettingsStore()),
nav: NavigationCoordinator(),
user_search_cache: user_search_cache,
music: nil,
video: VideoController(),
ndb: .empty

View File

@@ -734,8 +734,6 @@ func load_our_contacts(state: DamusState, m_old_ev: NostrEvent?, ev: NostrEvent)
}
}
}
state.user_search_cache.updateOwnContactsPetnames(id: contacts.our_pubkey, oldEvent: m_old_ev, newEvent: ev)
}