notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit eac5d41e3cb1587c65d1fe29cbc23df0ec302ed5
parent 952ba14d46ac8d9ab4e8f5894fca2920b6ef3c83
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  7 Nov 2025 11:56:45 -0800

fix nostrdb-rs platform independence

commit 6956b9f955463404b8eff3b7abe0cc3092cb5958
Author: Martti Malmi <sirius@iki.fi>
Date:   Fri Nov 7 17:35:31 2025 +0200

    fix non-android target metadata.rs u8

    platform-independent fix

diff --git a/src/metadata.rs b/src/metadata.rs
index 977cfc859915..bbaa0e4e724c 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -117,11 +117,9 @@ impl<'a> ReactionEntry<'a> {
     pub fn as_str(&'a self, buf: &'a mut [i8; 128]) -> &'a str {
         unsafe {
             let rstr = bindings::ndb_note_meta_reaction_str(self.as_ptr());
-            // weird android compilation issue
-            #[cfg(target_os = "android")]
-            let ptr = { bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr() as *mut u8) };
-            #[cfg(not(target_os = "android"))]
-            let ptr = { bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr()) };
+            // Cast to c_char for platform independence (i8 on Linux, u8 on macOS)
+            let ptr =
+                bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr() as *mut std::os::raw::c_char);
             let byte_slice: &[u8] = std::slice::from_raw_parts(ptr as *mut u8, libc::strlen(ptr));
             std::str::from_utf8_unchecked(byte_slice)
         }

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
MCargo.lock | 2+-
MCargo.toml | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -3520,7 +3520,7 @@ dependencies = [ [[package]] name = "nostrdb" version = "0.8.0" -source = "git+https://github.com/damus-io/nostrdb-rs?rev=035bb156dbedd7b058c7ccc176b7141b15436a41#035bb156dbedd7b058c7ccc176b7141b15436a41" +source = "git+https://github.com/damus-io/nostrdb-rs?rev=6956b9f955463404b8eff3b7abe0cc3092cb5958#6956b9f955463404b8eff3b7abe0cc3092cb5958" dependencies = [ "bindgen", "cc", diff --git a/Cargo.toml b/Cargo.toml @@ -46,7 +46,7 @@ md5 = "0.7.0" nostr = { version = "0.37.0", default-features = false, features = ["std", "nip49"] } nwc = "0.39.0" mio = { version = "1.0.3", features = ["os-poll", "net"] } -nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "035bb156dbedd7b058c7ccc176b7141b15436a41" } +nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "6956b9f955463404b8eff3b7abe0cc3092cb5958" } #nostrdb = "0.6.1" notedeck = { path = "crates/notedeck" } notedeck_chrome = { path = "crates/notedeck_chrome" }