1
0
mirror of git://jb55.com/damus synced 2024-09-18 19:23:49 +00:00

ndb: rename NostrEvent to NostrEventOld

This facilitates the switch to NdbNote by allowing us to switch back and
forth to fix things.
This commit is contained in:
William Casarin 2023-07-24 13:08:55 -07:00
parent 2d44f2744b
commit 45801f3e6c

View File

@ -20,7 +20,10 @@ enum ValidationResult: Decodable {
case bad_sig
}
class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Hashable, Comparable {
//typealias NostrEvent = NdbNote
typealias NostrEvent = NostrEventOld
class NostrEventOld: Codable, Identifiable, CustomStringConvertible, Equatable, Hashable, Comparable {
// TODO: memory mapped db events
/*
private var note_data: UnsafeMutablePointer<ndb_note>
@ -67,15 +70,15 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
private var _event_refs: [EventRef]? = nil
var decrypted_content: String? = nil
private var _blocks: Blocks? = nil
private lazy var inner_event: NostrEvent? = {
private lazy var inner_event: NostrEventOld? = {
return event_from_json(dat: self.content)
}()
static func == (lhs: NostrEvent, rhs: NostrEvent) -> Bool {
static func == (lhs: NostrEventOld, rhs: NostrEventOld) -> Bool {
return lhs.id == rhs.id
}
static func < (lhs: NostrEvent, rhs: NostrEvent) -> Bool {
static func < (lhs: NostrEventOld, rhs: NostrEventOld) -> Bool {
return lhs.created_at < rhs.created_at
}
@ -96,7 +99,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
}
}
extension NostrEvent {
extension NostrEventOld {
var is_textlike: Bool {
return kind == 1 || kind == 42 || kind == 30023
}
@ -127,7 +130,7 @@ extension NostrEvent {
}
func get_inner_event(cache: EventCache) -> NostrEvent? {
func get_inner_event(cache: EventCache) -> NostrEventOld? {
guard self.known_kind == .boost else {
return nil
}