diff --git a/nostrdb/NdbNote.swift b/nostrdb/NdbNote.swift index 097d0034..9ea0899a 100644 --- a/nostrdb/NdbNote.swift +++ b/nostrdb/NdbNote.swift @@ -34,7 +34,7 @@ enum NdbData { } } -class NdbNote { +class NdbNote: Equatable { // we can have owned notes, but we can also have lmdb virtual-memory mapped notes so its optional private let owned: Bool let count: Int @@ -94,6 +94,10 @@ class NdbNote { } } + static func == (lhs: NdbNote, rhs: NdbNote) -> Bool { + return lhs.id == rhs.id + } + static func owned_from_json(json: String, bufsize: Int = 2 << 18) -> NdbNote? { return json.withCString { cstr in return NdbNote.owned_from_json_cstr(