Files
damus/damus/Models/FollowTarget.swift
William Casarin cebd1f48ca 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
2023-08-03 13:20:36 -07:00

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
}
}
}