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
27 lines
412 B
Swift
27 lines
412 B
Swift
//
|
|
// FollowNotify.swift
|
|
// damus
|
|
//
|
|
// Created by William Casarin on 2022-05-24.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum FollowTarget {
|
|
case pubkey(Pubkey)
|
|
case contact(NostrEvent)
|
|
|
|
var follow_ref: FollowRef {
|
|
FollowRef.pubkey(pubkey)
|
|
}
|
|
|
|
var pubkey: Pubkey {
|
|
switch self {
|
|
case .pubkey(let pk): return pk
|
|
case .contact(let ev): return ev.pubkey
|
|
}
|
|
}
|
|
}
|
|
|
|
|