diff --git a/Cargo.lock b/Cargo.lock index 63fba34..6c5d192 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,7 +105,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.24" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d615619615a650c571269c00dca41db04b9210037fa76ed8239f70404ab56985" +checksum = "40f6024f3f856663b45fd0c9b6f2024034a702f453549449e0d84a305900dad4" dependencies = [ "deflate64", "flate2", @@ -295,7 +295,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -330,7 +330,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "av1-grain" @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "avif-serialize" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98922d6a4cfbcb08820c69d8eeccc05bb1f29bfa06b4f5b1dbfe9a868bd7608e" +checksum = "19135c0c7a60bfee564dbe44ab5ce0557c6bf3884e5291a50be76a15640c4fbd" dependencies = [ "arrayvec", ] @@ -514,7 +514,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.103", + "syn 2.0.104", "which", ] @@ -535,7 +535,7 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "shlex", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -627,7 +627,7 @@ checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" [[package]] name = "blade-graphics" version = "0.6.0" -source = "git+https://github.com/kvark/blade?rev=416375211bb0b5826b3584dccdb6a43369e499ad#416375211bb0b5826b3584dccdb6a43369e499ad" +source = "git+https://github.com/kvark/blade?rev=e0ec4e720957edd51b945b64dd85605ea54bcfe5#e0ec4e720957edd51b945b64dd85605ea54bcfe5" dependencies = [ "ash", "ash-window", @@ -660,17 +660,17 @@ dependencies = [ [[package]] name = "blade-macros" version = "0.3.0" -source = "git+https://github.com/kvark/blade?rev=416375211bb0b5826b3584dccdb6a43369e499ad#416375211bb0b5826b3584dccdb6a43369e499ad" +source = "git+https://github.com/kvark/blade?rev=e0ec4e720957edd51b945b64dd85605ea54bcfe5#e0ec4e720957edd51b945b64dd85605ea54bcfe5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "blade-util" version = "0.2.0" -source = "git+https://github.com/kvark/blade?rev=416375211bb0b5826b3584dccdb6a43369e499ad#416375211bb0b5826b3584dccdb6a43369e499ad" +source = "git+https://github.com/kvark/blade?rev=e0ec4e720957edd51b945b64dd85605ea54bcfe5#e0ec4e720957edd51b945b64dd85605ea54bcfe5" dependencies = [ "blade-graphics", "bytemuck", @@ -742,9 +742,9 @@ checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" [[package]] name = "bumpalo" -version = "3.18.1" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytemuck" @@ -763,7 +763,7 @@ checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -832,7 +832,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.103", + "syn 2.0.104", "tempfile", "toml", ] @@ -1079,7 +1079,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "indexmap", "rustc-hash 2.1.1", @@ -1122,9 +1122,11 @@ dependencies = [ "global", "gpui", "itertools 0.13.0", + "nostr", "nostr-connect", "nostr-sdk", "qrcode-generator", + "reqwest 0.12.20", "smallvec", "smol", "webbrowser", @@ -1181,6 +1183,7 @@ dependencies = [ "identity", "itertools 0.13.0", "log", + "nostr", "nostr-connect", "nostr-sdk", "oneshot", @@ -1467,17 +1470,17 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "workspace-hack", ] @@ -1557,7 +1560,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -1640,7 +1643,7 @@ dependencies = [ "rustc_version", "toml", "vswhom", - "winreg 0.55.0", + "winreg", ] [[package]] @@ -1667,18 +1670,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.103", -] - [[package]] name = "enumflags2" version = "0.7.12" @@ -1697,7 +1688,7 @@ checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -1717,7 +1708,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -1738,12 +1729,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1995,7 +1986,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -2130,7 +2121,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -2221,9 +2212,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" dependencies = [ "color_quant", "weezl", @@ -2326,7 +2317,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -2408,7 +2399,7 @@ dependencies = [ "windows 0.61.3", "windows-core 0.61.2", "windows-numerics", - "windows-registry 0.5.2", + "windows-registry 0.5.3", "workspace-hack", "x11-clipboard", "x11rb", @@ -2419,12 +2410,12 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "workspace-hack", ] @@ -2558,51 +2549,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "hickory-proto" -version = "0.24.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "once_cell", - "rand 0.8.5", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-resolver" -version = "0.24.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "hidden-trait" version = "0.1.2" @@ -2687,7 +2633,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "bytes", @@ -2704,7 +2650,7 @@ dependencies = [ [[package]] name = "http_client_tls" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "rustls", "rustls-platform-verifier", @@ -2752,7 +2698,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] @@ -2794,7 +2740,7 @@ dependencies = [ "tokio", "tower-service", "tracing", - "windows-registry 0.5.2", + "windows-registry 0.5.3", ] [[package]] @@ -2971,9 +2917,9 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d75c7014ddab93c232bc6bb9f64790d3dfd1d605199acd4b40b6d69e691e9f" +checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" dependencies = [ "byteorder-lite", "quick-error", @@ -3032,7 +2978,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -3056,18 +3002,6 @@ dependencies = [ "leaky-cow", ] -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2", - "widestring", - "windows-sys 0.48.0", - "winreg 0.50.0", -] - [[package]] name = "ipnet" version = "2.11.0" @@ -3170,9 +3104,9 @@ dependencies = [ [[package]] name = "jpeg-decoder" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" +checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" [[package]] name = "js-sys" @@ -3242,9 +3176,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.173" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libfuzzer-sys" @@ -3282,12 +3216,6 @@ dependencies = [ "libc", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linkify" version = "0.10.0" @@ -3361,15 +3289,6 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f8cc7106155f10bdf99a6f379688f543ad6596a415375b36a59a054ceda1198" -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "lru-slab" version = "0.1.2" @@ -3466,7 +3385,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "bindgen 0.71.1", @@ -3680,7 +3599,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "nostr" version = "0.42.1" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "aes", "base64", @@ -3704,7 +3623,7 @@ dependencies = [ [[package]] name = "nostr-connect" version = "0.42.0" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "async-utility", "nostr", @@ -3716,7 +3635,7 @@ dependencies = [ [[package]] name = "nostr-database" version = "0.42.0" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "flatbuffers", "lru", @@ -3727,7 +3646,7 @@ dependencies = [ [[package]] name = "nostr-lmdb" version = "0.42.0" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "async-utility", "heed", @@ -3740,7 +3659,7 @@ dependencies = [ [[package]] name = "nostr-relay-pool" version = "0.42.0" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "async-utility", "async-wsocket", @@ -3756,7 +3675,7 @@ dependencies = [ [[package]] name = "nostr-sdk" version = "0.42.0" -source = "git+https://github.com/rust-nostr/nostr#623230bd3c1e846089973a511f4aba614402ab56" +source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5" dependencies = [ "async-utility", "nostr", @@ -3844,7 +3763,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4121,7 +4040,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4291,7 +4210,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4326,7 +4245,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4440,12 +4359,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" dependencies = [ "proc-macro2", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4468,21 +4387,21 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" dependencies = [ "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -4578,9 +4497,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4e529991f949c5e25755532370b8af5d114acae52326361d68d47af64aa842" +checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ "cfg_aliases", "libc", @@ -4601,9 +4520,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" @@ -4707,9 +4626,9 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.12" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a5f31fcf7500f9401fea858ea4ab5525c99f2322cfcee732c0e6c74208c0c6" +checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" dependencies = [ "avif-serialize", "imgref", @@ -4791,7 +4710,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "derive_refineable", "workspace-hack", @@ -4837,7 +4756,6 @@ dependencies = [ "futures-core", "futures-util", "h2", - "hickory-resolver", "http", "http-body", "http-body-util", @@ -4920,13 +4838,13 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "bytes", @@ -4942,12 +4860,6 @@ dependencies = [ "workspace-hack", ] -[[package]] -name = "resolv-conf" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95325155c684b1c89f7765e30bc1c42e4a6da51ca513615660cb8a62ef9a88e3" - [[package]] name = "resvg" version = "0.45.1" @@ -5011,7 +4923,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.103", + "syn 2.0.104", "walkdir", ] @@ -5282,7 +5194,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5403,7 +5315,7 @@ checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749" [[package]] name = "semantic_version" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "serde", @@ -5433,7 +5345,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5444,7 +5356,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5490,7 +5402,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5741,7 +5653,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5754,7 +5666,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -5766,7 +5678,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "arrayvec", "log", @@ -5892,9 +5804,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.103" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -5927,7 +5839,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -6092,7 +6004,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -6103,7 +6015,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -6210,7 +6122,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -6373,13 +6285,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -6680,7 +6592,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#6d96f8be8e59188cf03371389b71377c9617fbd0" +source = "git+https://github.com/zed-industries/zed#108162423da6d5d37bd78bffed74e7ebc2e8a83b" dependencies = [ "anyhow", "async-fs", @@ -6883,7 +6795,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -6918,7 +6830,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7072,14 +6984,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" dependencies = [ - "webpki-root-certs 1.0.0", + "webpki-root-certs 1.0.1", ] [[package]] name = "webpki-root-certs" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a83f7e1a9f8712695c03eabe9ed3fbca0feff0152f33f12593e5a6303cb1a4" +checksum = "86138b15b2b7d561bc4469e77027b8dd005a43dc502e9031d1f5afc8ce1f280e" dependencies = [ "rustls-pki-types", ] @@ -7090,14 +7002,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "webpki-roots" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" +checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" dependencies = [ "rustls-pki-types", ] @@ -7131,12 +7043,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "widestring" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" - [[package]] name = "winapi" version = "0.3.9" @@ -7257,7 +7163,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -7268,7 +7174,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -7279,7 +7185,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -7290,7 +7196,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -7322,9 +7228,9 @@ dependencies = [ [[package]] name = "windows-registry" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bab093bdd303a1240bb99b8aba8ea8a69ee19d34c9e2ef9594e708a4878820" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ "windows-link", "windows-result 0.3.4", @@ -7403,6 +7309,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -7663,16 +7578,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "winreg" version = "0.55.0" @@ -7766,9 +7671,9 @@ dependencies = [ [[package]] name = "xcursor" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" +checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" [[package]] name = "xim" @@ -7860,7 +7765,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "synstructure", ] @@ -7906,7 +7811,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "zbus_names", "zvariant", "zvariant_utils", @@ -7932,22 +7837,22 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -7967,7 +7872,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "synstructure", ] @@ -7988,7 +7893,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -8021,7 +7926,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] @@ -8041,9 +7946,9 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6fe2e33d02a98ee64423802e16df3de99c43e5cf5ff983767e1128b394c8ac" +checksum = "7384255a918371b5af158218d131530f694de9ad3815ebdd0453a940485cb0fa" dependencies = [ "zune-core", ] @@ -8072,7 +7977,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "zvariant_utils", ] @@ -8086,6 +7991,6 @@ dependencies = [ "quote", "serde", "static_assertions", - "syn 2.0.103", + "syn 2.0.104", "winnow", ] diff --git a/Cargo.toml b/Cargo.toml index 5c99453..6a60a62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,16 +11,17 @@ publish = false [workspace.dependencies] coop = { path = "crates/*" } -# UI +# GPUI gpui = { git = "https://github.com/zed-industries/zed" } reqwest_client = { git = "https://github.com/zed-industries/zed" } # Nostr nostr = { git = "https://github.com/rust-nostr/nostr" } -nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = ["lmdb", "nip96", "nip59", "nip49", "nip44", "nip05"] } +nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = ["lmdb", "nip96", "nip59", "nip49", "nip44"] } nostr-connect = { git = "https://github.com/rust-nostr/nostr" } # Others +reqwest = { version = "0.12", features = ["stream"] } emojis = "0.6.4" smol = "2" futures = "0.3" diff --git a/crates/auto_update/Cargo.toml b/crates/auto_update/Cargo.toml index 6779137..0337536 100644 --- a/crates/auto_update/Cargo.toml +++ b/crates/auto_update/Cargo.toml @@ -12,7 +12,7 @@ gpui.workspace = true nostr-sdk.workspace = true anyhow.workspace = true smol.workspace = true +reqwest.workspace = true log.workspace = true tempfile = "3.19.1" -reqwest = { version = "0.12", features = ["stream"] } diff --git a/crates/chats/src/room.rs b/crates/chats/src/room.rs index 72b03ee..5b5d3d8 100644 --- a/crates/chats/src/room.rs +++ b/crates/chats/src/room.rs @@ -4,7 +4,6 @@ use std::sync::Arc; use anyhow::{anyhow, Error}; use chrono::{Local, TimeZone}; use common::profile::RenderProfile; -use common::{compare, room_hash}; use global::shared_state; use gpui::{App, AppContext, Context, EventEmitter, SharedString, Task, Window}; use identity::Identity; @@ -79,7 +78,7 @@ impl Room { /// /// A new Room instance with information extracted from the event pub fn new(event: &Event) -> Self { - let id = room_hash(event); + let id = common::room_hash(event); let created_at = event.created_at; // Get all pubkeys from the event's tags @@ -405,7 +404,7 @@ impl Room { let mut other_pubkeys = ev.tags.public_keys().copied().collect::>(); other_pubkeys.push(ev.pubkey); // Check if the event is from a member of the room - compare(&other_pubkeys, &pubkeys) + common::compare(&other_pubkeys, &pubkeys) }) .collect::>(); diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 6ddaf54..135a6ce 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -10,12 +10,14 @@ global = { path = "../global" } gpui.workspace = true nostr-connect.workspace = true nostr-sdk.workspace = true +nostr.workspace = true anyhow.workspace = true itertools.workspace = true chrono.workspace = true smallvec.workspace = true smol.workspace = true futures.workspace = true +reqwest.workspace = true webbrowser = "1.0.4" qrcode-generator = "5.0.0" diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 3a1c9cf..c3f8cfe 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -2,23 +2,43 @@ use std::collections::HashSet; use std::hash::{DefaultHasher, Hash, Hasher}; use std::sync::Arc; +use anyhow::{anyhow, Error, Result}; use gpui::{Image, ImageFormat}; use itertools::Itertools; use nostr_sdk::prelude::*; use qrcode_generator::QrCodeEcc; +use reqwest::Client as ReqClient; pub mod debounced_delay; pub mod handle_auth; pub mod profile; -pub async fn nip96_upload( - client: &Client, - upload_to: Url, - file: Vec, -) -> anyhow::Result { - let signer = client.signer().await?; +pub async fn verify_nip05(public_key: PublicKey, address: &str) -> Result { + let req_client = ReqClient::new(); + let address = Nip05Address::parse(address)?; + let res = req_client.get(address.url().to_string()).send().await?; + let json: Value = res.json().await?; + let verify = nip05::verify_from_json(&public_key, &address, &json); - let config: ServerConfig = nip96::get_server_config(upload_to.to_owned(), None).await?; + Ok(verify) +} + +pub async fn nip05_profile(address: &str) -> Result { + let req_client = ReqClient::new(); + let address = Nip05Address::parse(address)?; + let res = req_client.get(address.url().to_string()).send().await?; + let json: Value = res.json().await?; + + if let Ok(profile) = Nip05Profile::from_json(&address, &json) { + Ok(profile) + } else { + Err(anyhow!("Failed to get NIP-05 profile")) + } +} + +pub async fn nip96_upload(client: &Client, server: Url, file: Vec) -> Result { + let signer = client.signer().await?; + let config = nip96::get_server_config(server.to_owned(), None).await?; let url = nip96::upload_data(&signer, &config, file, None, None).await?; Ok(url) @@ -26,10 +46,10 @@ pub async fn nip96_upload( pub fn room_hash(event: &Event) -> u64 { let mut hasher = DefaultHasher::new(); - let mut pubkeys: Vec<&PublicKey> = vec![]; + let mut pubkeys: Vec = vec![]; // Add all public keys from event - pubkeys.push(&event.pubkey); + pubkeys.push(event.pubkey); pubkeys.extend(event.tags.public_keys().collect::>()); // Generate unique hash diff --git a/crates/coop/Cargo.toml b/crates/coop/Cargo.toml index 9ea758d..7536e7f 100644 --- a/crates/coop/Cargo.toml +++ b/crates/coop/Cargo.toml @@ -24,6 +24,7 @@ reqwest_client.workspace = true nostr-connect.workspace = true nostr-sdk.workspace = true +nostr.workspace = true anyhow.workspace = true serde.workspace = true diff --git a/crates/coop/src/chatspace.rs b/crates/coop/src/chatspace.rs index 1ac9c1f..cbc4cba 100644 --- a/crates/coop/src/chatspace.rs +++ b/crates/coop/src/chatspace.rs @@ -7,8 +7,8 @@ use global::constants::{DEFAULT_MODAL_WIDTH, DEFAULT_SIDEBAR_WIDTH}; use global::shared_state; use gpui::prelude::FluentBuilder; use gpui::{ - div, impl_internal_actions, px, relative, App, AppContext, Axis, Context, Entity, IntoElement, - ParentElement, Render, Styled, Subscription, Task, Window, + div, px, relative, Action, App, AppContext, Axis, Context, Entity, IntoElement, ParentElement, + Render, Styled, Subscription, Task, Window, }; use identity::Identity; use nostr_connect::prelude::*; @@ -25,8 +25,6 @@ use ui::{ContextModal, IconName, Root, Sizable, StyledExt, TitleBar}; use crate::views::chat::{self, Chat}; use crate::views::{login, new_account, onboarding, preferences, sidebar, startup, welcome}; -impl_internal_actions!(dock, [ToggleModal]); - pub fn init(window: &mut Window, cx: &mut App) -> Entity { ChatSpace::new(window, cx) } @@ -56,7 +54,8 @@ pub enum ModalKind { SetupRelay, } -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = modal, no_json)] pub struct ToggleModal { pub modal: ModalKind, } diff --git a/crates/coop/src/views/chat.rs b/crates/coop/src/views/chat.rs index 36041c2..28b91d8 100644 --- a/crates/coop/src/views/chat.rs +++ b/crates/coop/src/views/chat.rs @@ -10,11 +10,11 @@ use common::profile::RenderProfile; use global::shared_state; use gpui::prelude::FluentBuilder; use gpui::{ - div, img, impl_internal_actions, list, px, red, relative, rems, svg, white, AnyElement, App, - AppContext, ClipboardItem, Context, Div, Element, Empty, Entity, EventEmitter, Flatten, - FocusHandle, Focusable, InteractiveElement, IntoElement, ListAlignment, ListState, ObjectFit, - ParentElement, PathPromptOptions, Render, RetainAllImageCache, SharedString, - StatefulInteractiveElement, Styled, StyledImage, Subscription, Window, + div, img, list, px, red, relative, rems, svg, white, Action, AnyElement, App, AppContext, + ClipboardItem, Context, Div, Element, Empty, Entity, EventEmitter, Flatten, FocusHandle, + Focusable, InteractiveElement, IntoElement, ListAlignment, ListState, ObjectFit, ParentElement, + PathPromptOptions, Render, RetainAllImageCache, SharedString, StatefulInteractiveElement, + Styled, StyledImage, Subscription, Window, }; use identity::Identity; use itertools::Itertools; @@ -38,11 +38,10 @@ use ui::{ use crate::views::subject; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = chat, no_json)] pub struct ChangeSubject(pub String); -impl_internal_actions!(chat, [ChangeSubject]); - pub fn init(room: Entity, window: &mut Window, cx: &mut App) -> Arc> { Arc::new(Chat::new(room, window, cx)) } diff --git a/crates/coop/src/views/compose.rs b/crates/coop/src/views/compose.rs index 0d137fc..3cf79df 100644 --- a/crates/coop/src/views/compose.rs +++ b/crates/coop/src/views/compose.rs @@ -4,17 +4,17 @@ use std::time::Duration; use anyhow::{anyhow, Error}; use chats::room::{Room, RoomKind}; use chats::ChatRegistry; +use common::nip05_profile; use common::profile::RenderProfile; use global::shared_state; use gpui::prelude::FluentBuilder; use gpui::{ - div, img, impl_internal_actions, px, red, relative, uniform_list, App, AppContext, Context, - Entity, InteractiveElement, IntoElement, ParentElement, Render, SharedString, + div, img, px, red, relative, uniform_list, App, AppContext, Context, Entity, + InteractiveElement, IntoElement, ParentElement, Render, SharedString, StatefulInteractiveElement, Styled, Subscription, Task, TextAlign, Window, }; use itertools::Itertools; use nostr_sdk::prelude::*; -use serde::Deserialize; use settings::AppSettings; use smallvec::{smallvec, SmallVec}; use smol::Timer; @@ -28,11 +28,6 @@ pub fn init(window: &mut Window, cx: &mut App) -> Entity { cx.new(|cx| Compose::new(window, cx)) } -#[derive(Clone, PartialEq, Eq, Deserialize)] -struct SelectContact(PublicKey); - -impl_internal_actions!(contacts, [SelectContact]); - #[derive(Debug, Clone)] struct Contact { profile: Profile, @@ -245,15 +240,14 @@ impl Compose { let task: Task> = if content.contains("@") { cx.background_spawn(async move { - let (tx, rx) = oneshot::channel::(); + let (tx, rx) = oneshot::channel::>(); nostr_sdk::async_utility::task::spawn(async move { - if let Ok(profile) = nip05::profile(&content, None).await { - tx.send(profile).ok(); - } + let profile = nip05_profile(&content).await.ok(); + tx.send(profile).ok(); }); - if let Ok(profile) = rx.await { + if let Ok(Some(profile)) = rx.await { let public_key = profile.public_key; let metadata = shared_state() .client() diff --git a/crates/coop/src/views/sidebar/mod.rs b/crates/coop/src/views/sidebar/mod.rs index b13f8a0..f0ea5f8 100644 --- a/crates/coop/src/views/sidebar/mod.rs +++ b/crates/coop/src/views/sidebar/mod.rs @@ -7,6 +7,7 @@ use chats::room::{Room, RoomKind}; use chats::{ChatRegistry, RoomEmitter}; use common::debounced_delay::DebouncedDelay; use common::profile::RenderProfile; +use common::verify_nip05; use element::DisplayRoom; use global::constants::{DEFAULT_MODAL_WIDTH, SEARCH_RELAYS}; use global::shared_state; @@ -184,13 +185,8 @@ impl Sidebar { continue; }; - let Ok(verified) = nip05::verify(&event.pubkey, target, None).await else { - // Skip if NIP-05 verification fails - continue; - }; - - if !verified { - // Skip if NIP-05 is not valid + if !verify_nip05(event.pubkey, target).await.unwrap_or(false) { + // Skip if NIP-05 is not valid or failed to verify continue; }; diff --git a/crates/ui/src/actions.rs b/crates/ui/src/actions.rs index 17acbb6..9be2fa1 100644 --- a/crates/ui/src/actions.rs +++ b/crates/ui/src/actions.rs @@ -1,11 +1,11 @@ -use gpui::{actions, impl_internal_actions}; +use gpui::{actions, Action}; use serde::Deserialize; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Clone, Action, PartialEq, Eq, Deserialize)] +#[action(namespace = list, no_json)] pub struct Confirm { /// Is confirm with secondary. pub secondary: bool, } actions!(list, [Cancel, SelectPrev, SelectNext]); -impl_internal_actions!(list, [Confirm]); diff --git a/crates/ui/src/emoji_picker.rs b/crates/ui/src/emoji_picker.rs index f730156..c838cc9 100644 --- a/crates/ui/src/emoji_picker.rs +++ b/crates/ui/src/emoji_picker.rs @@ -2,9 +2,9 @@ use std::rc::Rc; use gpui::prelude::FluentBuilder; use gpui::{ - div, impl_internal_actions, px, App, AppContext, Corner, Element, InteractiveElement, - IntoElement, ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled, - WeakEntity, Window, + div, px, Action, App, AppContext, Corner, Element, InteractiveElement, IntoElement, + ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled, WeakEntity, + Window, }; use serde::Deserialize; use theme::ActiveTheme; @@ -14,11 +14,10 @@ use crate::input::InputState; use crate::popover::{Popover, PopoverContent}; use crate::Icon; -#[derive(PartialEq, Clone, Debug, Deserialize)] +#[derive(Action, PartialEq, Clone, Debug, Deserialize)] +#[action(namespace = emoji, no_json)] pub struct EmitEmoji(pub SharedString); -impl_internal_actions!(emoji, [EmitEmoji]); - #[derive(IntoElement)] pub struct EmojiPicker { icon: Option, diff --git a/crates/ui/src/input/state.rs b/crates/ui/src/input/state.rs index 2e8a018..cc630da 100644 --- a/crates/ui/src/input/state.rs +++ b/crates/ui/src/input/state.rs @@ -4,8 +4,8 @@ use std::rc::Rc; use gpui::prelude::FluentBuilder as _; use gpui::{ - actions, div, impl_internal_actions, point, px, App, AppContext, Bounds, ClipboardItem, - Context, DefiniteLength, Entity, EntityInputHandler, EventEmitter, FocusHandle, Focusable, + actions, div, point, px, Action, App, AppContext, Bounds, ClipboardItem, Context, + DefiniteLength, Entity, EntityInputHandler, EventEmitter, FocusHandle, Focusable, InteractiveElement as _, IntoElement, KeyBinding, KeyDownEvent, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels, Point, Render, ScrollHandle, ScrollWheelEvent, SharedString, Styled as _, Subscription, UTF16Selection, Window, WrappedLine, @@ -24,14 +24,13 @@ use crate::history::History; use crate::scroll::ScrollbarState; use crate::Root; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = input, no_json)] pub struct Enter { /// Is confirm with secondary. pub secondary: bool, } -impl_internal_actions!(input, [Enter]); - actions!( input, [