refactor: add Pubkey, Privkey, NoteId string aliases

This is a non-behavioral change in preparation for the actual switchover
from Strings to Ids. The purpose of this kit is to reduce the size of
the switchover commit which is going to be very large.
This commit is contained in:
William Casarin
2023-07-31 03:57:26 -07:00
parent f9d21ef901
commit 7040235605
101 changed files with 427 additions and 426 deletions

View File

@@ -11,18 +11,18 @@ class FollowingModel {
let damus_state: DamusState
var needs_sub: Bool = true
let contacts: [String]
let contacts: [Pubkey]
let sub_id: String = UUID().description
init(damus_state: DamusState, contacts: [String]) {
init(damus_state: DamusState, contacts: [Pubkey]) {
self.damus_state = damus_state
self.contacts = contacts
}
func get_filter() -> NostrFilter {
var f = NostrFilter(kinds: [.metadata])
f.authors = self.contacts.reduce(into: Array<String>()) { acc, pk in
f.authors = self.contacts.reduce(into: Array<Pubkey>()) { acc, pk in
// don't fetch profiles we already have
if damus_state.profiles.has_fresh_profile(id: pk) {
return