damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 2053033b257593519237fe3734e401a2cae58a59
parent 45801f3e6c4adc9013b44901a605ce6c9d963fc1
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 24 Jul 2023 13:09:27 -0700

ndb: make note equatble

We need this for the switchover

Diffstat:
Mnostrdb/NdbNote.swift | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 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(