update messaging relays panel
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m41s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m46s
Rust / build (macos-latest, stable) (push) Has been cancelled
Rust / build (windows-latest, stable) (push) Has been cancelled
Rust / build (macos-latest, stable) (pull_request) Has been cancelled
Rust / build (windows-latest, stable) (pull_request) Has been cancelled

This commit is contained in:
2026-02-23 19:23:56 +07:00
parent 2ec98e14d0
commit ebf0e86828
2 changed files with 246 additions and 217 deletions

190
Cargo.lock generated
View File

@@ -220,9 +220,9 @@ dependencies = [
[[package]]
name = "ashpd"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "522dc9bec59923af17c43c5911cdabbacdb32ed4f955e83ecf592855618b20b5"
checksum = "33a3c86f3fd70c0ffa500ed189abfa90b5a52398a45d5dc372fcc38ebeb7a645"
dependencies = [
"async-fs",
"async-net",
@@ -349,7 +349,7 @@ dependencies = [
"futures-lite 2.6.1",
"parking",
"polling",
"rustix 1.1.3",
"rustix 1.1.4",
"slab",
"windows-sys 0.61.2",
]
@@ -391,7 +391,7 @@ dependencies = [
"cfg-if",
"event-listener 5.4.1",
"futures-lite 2.6.1",
"rustix 1.1.3",
"rustix 1.1.4",
]
[[package]]
@@ -417,7 +417,7 @@ dependencies = [
"cfg-if",
"futures-core",
"futures-io",
"rustix 1.1.3",
"rustix 1.1.4",
"signal-hook-registry",
"slab",
"windows-sys 0.61.2",
@@ -862,7 +862,7 @@ checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7"
dependencies = [
"bitflags 2.11.0",
"polling",
"rustix 1.1.3",
"rustix 1.1.4",
"slab",
"tracing",
]
@@ -874,7 +874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
dependencies = [
"calloop",
"rustix 1.1.3",
"rustix 1.1.4",
"wayland-backend",
"wayland-client",
]
@@ -1192,7 +1192,7 @@ dependencies = [
[[package]]
name = "collections"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"indexmap",
"rustc-hash 2.1.1",
@@ -1443,9 +1443,9 @@ dependencies = [
[[package]]
name = "core-graphics2"
version = "0.4.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e4583956b9806b69f73fcb23aee05eb3620efc282972f08f6a6db7504f8334d"
checksum = "4416167a69126e617f8d0a214af0e3c1dbdeffcb100ddf72dcd1a1ac9893c146"
dependencies = [
"bitflags 2.11.0",
"block",
@@ -1467,16 +1467,16 @@ dependencies = [
[[package]]
name = "core-video"
version = "0.4.3"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d45e71d5be22206bed53c3c3cb99315fc4c3d31b8963808c6bc4538168c4f8ef"
checksum = "139679cc63eb9504bdbe37e37874b0247136177655f0008588781e90863afa62"
dependencies = [
"block",
"core-foundation 0.10.0",
"core-graphics2",
"io-surface",
"libc",
"metal 0.29.0",
"metal",
]
[[package]]
@@ -1640,7 +1640,7 @@ dependencies = [
[[package]]
name = "derive_refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"proc-macro2",
"quote",
@@ -2417,7 +2417,7 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
dependencies = [
"rustix 1.1.3",
"rustix 1.1.4",
"windows-link 0.2.1",
]
@@ -2577,7 +2577,7 @@ dependencies = [
[[package]]
name = "gpui"
version = "0.2.2"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"async-task",
@@ -2610,7 +2610,7 @@ dependencies = [
"lyon",
"mach2",
"media",
"metal 0.29.0",
"metal",
"naga",
"num_cpus",
"objc",
@@ -2651,7 +2651,7 @@ dependencies = [
[[package]]
name = "gpui_linux"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"as-raw-xcb-connection",
@@ -2699,7 +2699,7 @@ dependencies = [
[[package]]
name = "gpui_macos"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"async-task",
@@ -2725,7 +2725,7 @@ dependencies = [
"log",
"mach2",
"media",
"metal 0.29.0",
"metal",
"objc",
"parking_lot",
"pathfinder_geometry",
@@ -2741,7 +2741,7 @@ dependencies = [
[[package]]
name = "gpui_macros"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -2752,7 +2752,7 @@ dependencies = [
[[package]]
name = "gpui_platform"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"gpui",
"gpui_linux",
@@ -2763,7 +2763,7 @@ dependencies = [
[[package]]
name = "gpui_tokio"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"gpui",
@@ -2774,7 +2774,7 @@ dependencies = [
[[package]]
name = "gpui_wgpu"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"bytemuck",
@@ -2793,7 +2793,7 @@ dependencies = [
[[package]]
name = "gpui_windows"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"collections",
@@ -3037,7 +3037,7 @@ dependencies = [
[[package]]
name = "http_client"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"async-compression",
@@ -3062,7 +3062,7 @@ dependencies = [
[[package]]
name = "http_client_tls"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"rustls",
"rustls-platform-verifier",
@@ -3151,7 +3151,7 @@ dependencies = [
"tokio",
"tower-service",
"tracing",
"windows-registry 0.5.3",
"windows-registry 0.6.1",
]
[[package]]
@@ -3503,9 +3503,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.86"
version = "0.3.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36139f1c97c42c0c86a411910b04e48d4939a0376e6e0f989420cbdee0120e5"
checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d"
dependencies = [
"once_cell",
"wasm-bindgen",
@@ -3664,9 +3664,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]]
name = "litemap"
@@ -3843,7 +3843,7 @@ dependencies = [
[[package]]
name = "media"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"bindgen",
@@ -3851,7 +3851,7 @@ dependencies = [
"core-video",
"ctor",
"foreign-types 0.5.0",
"metal 0.29.0",
"metal",
"objc",
]
@@ -3888,21 +3888,6 @@ dependencies = [
"autocfg",
]
[[package]]
name = "metal"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
dependencies = [
"bitflags 2.11.0",
"block",
"core-graphics-types 0.1.3",
"foreign-types 0.5.0",
"log",
"objc",
"paste",
]
[[package]]
name = "metal"
version = "0.33.0"
@@ -4102,7 +4087,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
[[package]]
name = "nostr"
version = "0.44.1"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"aes",
"base64",
@@ -4127,7 +4112,7 @@ dependencies = [
[[package]]
name = "nostr-connect"
version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"async-utility",
"futures-core",
@@ -4140,7 +4125,7 @@ dependencies = [
[[package]]
name = "nostr-database"
version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"btreecap",
"flatbuffers",
@@ -4152,7 +4137,7 @@ dependencies = [
[[package]]
name = "nostr-gossip"
version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"nostr",
]
@@ -4160,7 +4145,7 @@ dependencies = [
[[package]]
name = "nostr-lmdb"
version = "0.44.0"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"async-utility",
"flume",
@@ -4174,7 +4159,7 @@ dependencies = [
[[package]]
name = "nostr-sdk"
version = "0.44.1"
source = "git+https://github.com/rust-nostr/nostr#2d1000b05b2a37de940857cbfb5660dd0c9ec373"
source = "git+https://github.com/rust-nostr/nostr#c6ada24c23b25b8b6e8f5468fc56a3c149ae9a93"
dependencies = [
"async-utility",
"async-wsocket",
@@ -4648,7 +4633,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "perf"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"collections",
"serde",
@@ -4817,7 +4802,7 @@ dependencies = [
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
"rustix 1.1.3",
"rustix 1.1.4",
"windows-sys 0.61.2",
]
@@ -5323,7 +5308,7 @@ dependencies = [
[[package]]
name = "refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"derive_refineable",
]
@@ -5428,7 +5413,7 @@ dependencies = [
[[package]]
name = "reqwest_client"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"bytes",
@@ -5483,7 +5468,7 @@ dependencies = [
[[package]]
name = "rope"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"arrayvec",
"log",
@@ -5588,14 +5573,14 @@ dependencies = [
[[package]]
name = "rustix"
version = "1.1.3"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags 2.11.0",
"errno",
"libc",
"linux-raw-sys 0.11.0",
"linux-raw-sys 0.12.1",
"windows-sys 0.61.2",
]
@@ -5745,7 +5730,7 @@ dependencies = [
[[package]]
name = "scheduler"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"async-task",
"backtrace",
@@ -6326,7 +6311,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "sum_tree"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"arrayvec",
"log",
@@ -6574,7 +6559,7 @@ dependencies = [
"fastrand 2.3.0",
"getrandom 0.4.1",
"once_cell",
"rustix 1.1.3",
"rustix 1.1.4",
"windows-sys 0.61.2",
]
@@ -7284,7 +7269,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "util"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"async-fs",
@@ -7322,7 +7307,7 @@ dependencies = [
[[package]]
name = "util_macros"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"perf",
"quote",
@@ -7484,9 +7469,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]]
name = "wasm-bindgen"
version = "0.2.109"
version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ff9c7baef35ac3c0e17d8bfc9ad75eb62f85a2f02bccc906699dadb0aa9c622"
checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac"
dependencies = [
"cfg-if",
"once_cell",
@@ -7497,9 +7482,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.59"
version = "0.4.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24699cd39db9966cf6e2ef10d2f72779c961ad905911f395ea201c3ec9f545d"
checksum = "fe88540d1c934c4ec8e6db0afa536876c5441289d7f9f9123d4f065ac1250a6b"
dependencies = [
"cfg-if",
"futures-util",
@@ -7511,9 +7496,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.109"
version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39455e84ad887a0bbc93c116d72403f1bb0a39e37dd6f235a43e2128a0c7f1fd"
checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -7521,9 +7506,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.109"
version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff4761f60b0b51fd13fec8764167b7bbcc34498ce3e52805fe1db6f2d56b6d6"
checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af"
dependencies = [
"bumpalo",
"proc-macro2",
@@ -7534,9 +7519,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.109"
version = "0.2.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6a171c53d98021a93a474c4a4579d76ba97f9517d871bc12e27640f218b6dd"
checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41"
dependencies = [
"unicode-ident",
]
@@ -7596,7 +7581,7 @@ checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9"
dependencies = [
"cc",
"downcast-rs",
"rustix 1.1.3",
"rustix 1.1.4",
"scoped-tls",
"smallvec",
"wayland-sys",
@@ -7609,7 +7594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
dependencies = [
"bitflags 2.11.0",
"rustix 1.1.3",
"rustix 1.1.4",
"wayland-backend",
"wayland-scanner",
]
@@ -7620,7 +7605,7 @@ version = "0.31.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078"
dependencies = [
"rustix 1.1.3",
"rustix 1.1.4",
"wayland-client",
"xcursor",
]
@@ -7688,9 +7673,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.86"
version = "0.3.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668fa5d00434e890a452ab060d24e3904d1be93f7bb01b70e5603baa2b8ab23b"
checksum = "9d6bb20ed2d9572df8584f6dc81d68a41a625cadc6f15999d649a70ce7e3597a"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -7879,7 +7864,7 @@ dependencies = [
"libc",
"libloading",
"log",
"metal 0.33.0",
"metal",
"naga",
"ndk-sys",
"objc",
@@ -8192,6 +8177,17 @@ dependencies = [
"windows-strings 0.4.2",
]
[[package]]
name = "windows-registry"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
dependencies = [
"windows-link 0.2.1",
"windows-result 0.4.1",
"windows-strings 0.5.1",
]
[[package]]
name = "windows-result"
version = "0.1.2"
@@ -8718,7 +8714,7 @@ dependencies = [
"as-raw-xcb-connection",
"gethostname",
"libc",
"rustix 1.1.3",
"rustix 1.1.4",
"x11rb-protocol",
"xcursor",
]
@@ -8850,9 +8846,9 @@ dependencies = [
[[package]]
name = "zbus"
version = "5.13.2"
version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfeff997a0aaa3eb20c4652baf788d2dfa6d2839a0ead0b3ff69ce2f9c4bdd1"
checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc"
dependencies = [
"async-broadcast",
"async-executor",
@@ -8870,7 +8866,7 @@ dependencies = [
"hex",
"libc",
"ordered-stream",
"rustix 1.1.3",
"rustix 1.1.4",
"serde",
"serde_repr",
"tracing",
@@ -8885,9 +8881,9 @@ dependencies = [
[[package]]
name = "zbus_macros"
version = "5.13.2"
version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bbd5a90dbe8feee5b13def448427ae314ccd26a49cac47905cafefb9ff846f1"
checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -9119,7 +9115,7 @@ dependencies = [
[[package]]
name = "zlog"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"anyhow",
"chrono",
@@ -9136,7 +9132,7 @@ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
[[package]]
name = "ztracing"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
dependencies = [
"tracing",
"tracing-subscriber",
@@ -9147,7 +9143,7 @@ dependencies = [
[[package]]
name = "ztracing_macro"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#930d9321dc66d7fc8a2f7d977f668431c9549b33"
source = "git+https://github.com/zed-industries/zed#67d9e7d0119aad7f27a1de76befd750303db27fc"
[[package]]
name = "zune-core"
@@ -9190,9 +9186,9 @@ dependencies = [
[[package]]
name = "zvariant"
version = "5.9.2"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b64ef4f40c7951337ddc7023dd03528a57a3ce3408ee9da5e948bd29b232c4"
checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b"
dependencies = [
"endi",
"enumflags2",
@@ -9205,9 +9201,9 @@ dependencies = [
[[package]]
name = "zvariant_derive"
version = "5.9.2"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "484d5d975eb7afb52cc6b929c13d3719a20ad650fea4120e6310de3fc55e415c"
checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c"
dependencies = [
"proc-macro-crate",
"proc-macro2",

View File

@@ -4,9 +4,9 @@ use std::time::Duration;
use anyhow::{anyhow, Context as AnyhowContext, Error};
use gpui::prelude::FluentBuilder;
use gpui::{
div, relative, uniform_list, AnyElement, App, AppContext, Context, Entity, EventEmitter,
FocusHandle, Focusable, InteractiveElement, IntoElement, ParentElement, Render, SharedString,
Styled, Subscription, Task, TextAlign, UniformList, Window,
div, rems, AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
InteractiveElement, IntoElement, ParentElement, Render, SharedString, Styled, Subscription,
Task, TextAlign, Window,
};
use nostr_sdk::prelude::*;
use smallvec::{smallvec, SmallVec};
@@ -15,7 +15,10 @@ use theme::ActiveTheme;
use ui::button::{Button, ButtonVariants};
use ui::dock_area::panel::{Panel, PanelEvent};
use ui::input::{InputEvent, InputState, TextInput};
use ui::{divider, h_flex, v_flex, IconName, Sizable, StyledExt};
use ui::{divider, h_flex, v_flex, Disableable, IconName, Sizable, StyledExt, WindowExtension};
const MSG: &str = "Messaging Relays are relays that hosted all your messages. \
Other users will find your relays and send messages to it.";
pub fn init(window: &mut Window, cx: &mut App) -> Entity<MessagingRelayPanel> {
cx.new(|cx| MessagingRelayPanel::new(window, cx))
@@ -29,44 +32,26 @@ pub struct MessagingRelayPanel {
/// Relay URL input
input: Entity<InputState>,
/// Whether the panel is updating
updating: bool,
/// Error message
error: Option<SharedString>,
// All relays
/// All relays
relays: HashSet<RelayUrl>,
// Event subscriptions
/// Event subscriptions
_subscriptions: SmallVec<[Subscription; 1]>,
// Background tasks
_tasks: SmallVec<[Task<()>; 1]>,
/// Background tasks
tasks: Vec<Task<Result<(), Error>>>,
}
impl MessagingRelayPanel {
pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self {
let input = cx.new(|cx| InputState::new(window, cx).placeholder("wss://example.com"));
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let mut subscriptions = smallvec![];
let mut tasks = smallvec![];
tasks.push(
// Load user's relays in the local database
cx.spawn_in(window, async move |this, cx| {
let result = cx
.background_spawn(async move { Self::load(&client).await })
.await;
if let Ok(relays) = result {
this.update(cx, |this, cx| {
this.relays.extend(relays);
cx.notify();
})
.ok();
}
}),
);
subscriptions.push(
// Subscribe to user's input events
@@ -77,31 +62,54 @@ impl MessagingRelayPanel {
}),
);
// Run at the end of current cycle
cx.defer_in(window, |this, window, cx| {
this.load(window, cx);
});
Self {
name: "Update Messaging Relays".into(),
focus_handle: cx.focus_handle(),
input,
updating: false,
relays: HashSet::new(),
error: None,
_subscriptions: subscriptions,
_tasks: tasks,
tasks: vec![],
}
}
async fn load(client: &Client) -> Result<Vec<RelayUrl>, Error> {
let signer = client.signer().context("Signer not found")?;
let public_key = signer.get_public_key().await?;
fn load(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let filter = Filter::new()
.kind(Kind::InboxRelays)
.author(public_key)
.limit(1);
let task: Task<Result<Vec<RelayUrl>, Error>> = cx.background_spawn(async move {
let signer = client.signer().context("Signer not found")?;
let public_key = signer.get_public_key().await?;
if let Some(event) = client.database().query(filter).await?.first_owned() {
Ok(nip17::extract_owned_relay_list(event).collect())
} else {
Err(anyhow!("Not found."))
}
let filter = Filter::new()
.kind(Kind::InboxRelays)
.author(public_key)
.limit(1);
if let Some(event) = client.database().query(filter).await?.first_owned() {
Ok(nip17::extract_owned_relay_list(event).collect())
} else {
Err(anyhow!("Not found."))
}
});
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
let relays = task.await?;
// Update state
this.update(cx, |this, cx| {
this.relays.extend(relays);
cx.notify();
})?;
Ok(())
}));
}
fn add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
@@ -113,7 +121,7 @@ impl MessagingRelayPanel {
}
if let Ok(url) = RelayUrl::parse(&value) {
if !self.relays.insert(url) {
if self.relays.insert(url) {
self.input.update(cx, |this, cx| {
this.set_value("", window, cx);
});
@@ -148,6 +156,11 @@ impl MessagingRelayPanel {
.detach();
}
fn set_updating(&mut self, updating: bool, cx: &mut Context<Self>) {
self.updating = updating;
cx.notify();
}
pub fn set_relays(&mut self, window: &mut Window, cx: &mut Context<Self>) {
if self.relays.is_empty() {
self.set_error("You need to add at least 1 relay", window, cx);
@@ -156,99 +169,99 @@ impl MessagingRelayPanel {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
let Some(public_key) = signer.public_key() else {
window.push_notification("Public Key not found", cx);
return;
};
// Get user's write relays
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
// Construct event tags
let tags: Vec<Tag> = self
.relays
.iter()
.map(|relay| Tag::relay(relay.clone()))
.collect();
// Set updating state
self.set_updating(true, cx);
let task: Task<Result<(), Error>> = cx.background_spawn(async move {
let urls = write_relays.await;
// Construct nip17 event builder
let builder = EventBuilder::new(Kind::InboxRelays, "").tags(tags);
let event = client.sign_event_builder(builder).await?;
// Set messaging relays
client.send_event(&event).to_nip65().await?;
client.send_event(&event).to(urls).await?;
Ok(())
});
cx.spawn_in(window, async move |this, cx| {
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
match task.await {
Ok(_) => {
// TODO
this.update_in(cx, |this, window, cx| {
this.set_updating(false, cx);
this.load(window, cx);
window.push_notification("Update successful", cx);
})?;
}
Err(e) => {
this.update_in(cx, |this, window, cx| {
this.set_error(e.to_string(), window, cx);
})
.ok();
})?;
}
};
})
.detach();
Ok(())
}));
}
fn render_list(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> UniformList {
let relays = self.relays.clone();
let total = relays.len();
fn render_list_items(&mut self, cx: &mut Context<Self>) -> Vec<impl IntoElement> {
let mut items = Vec::new();
uniform_list(
"relays",
total,
cx.processor(move |_v, range, _window, cx| {
let mut items = Vec::new();
for url in self.relays.iter() {
items.push(
h_flex()
.id(SharedString::from(url.to_string()))
.group("")
.flex_1()
.w_full()
.h_8()
.px_2()
.justify_between()
.rounded(cx.theme().radius)
.bg(cx.theme().secondary_background)
.text_color(cx.theme().secondary_foreground)
.child(div().text_sm().child(SharedString::from(url.to_string())))
.child(
Button::new("remove_{ix}")
.icon(IconName::Close)
.xsmall()
.ghost()
.invisible()
.group_hover("", |this| this.visible())
.on_click({
let url = url.to_owned();
cx.listener(move |this, _ev, _window, cx| {
this.remove(&url, cx);
})
}),
),
)
}
for ix in range {
let Some(url) = relays.iter().nth(ix) else {
continue;
};
items.push(
div()
.id(SharedString::from(url.to_string()))
.group("")
.w_full()
.h_9()
.py_0p5()
.child(
h_flex()
.px_2()
.flex()
.justify_between()
.rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background)
.child(
div().text_sm().child(SharedString::from(url.to_string())),
)
.child(
Button::new("remove_{ix}")
.icon(IconName::Close)
.xsmall()
.ghost()
.invisible()
.group_hover("", |this| this.visible())
.on_click({
let url = url.to_owned();
cx.listener(move |this, _ev, _window, cx| {
this.remove(&url, cx);
})
}),
),
),
)
}
items
}),
)
.h_full()
items
}
fn render_empty(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
h_flex()
.mt_2()
.h_20()
.justify_center()
.border_2()
@@ -282,36 +295,48 @@ impl Focusable for MessagingRelayPanel {
impl Render for MessagingRelayPanel {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
v_flex()
.size_full()
.items_center()
.justify_center()
.p_2()
.gap_10()
.p_3()
.gap_2()
.w_full()
.child(
div()
.text_center()
.font_semibold()
.line_height(relative(1.25))
.child(SharedString::from("Update Messaging Relays")),
.text_xs()
.text_color(cx.theme().text_muted)
.child(SharedString::from(MSG)),
)
.child(divider(cx))
.child(
v_flex()
.w_112()
.gap_2()
.flex_1()
.w_full()
.text_sm()
.child(
div()
.text_xs()
.font_semibold()
.text_color(cx.theme().text_muted)
.child(SharedString::from("Relays:")),
)
.child(
v_flex()
.gap_1p5()
.gap_1()
.child(
h_flex()
.gap_1()
.w_full()
.child(TextInput::new(&self.input).small())
.child(
TextInput::new(&self.input)
.small()
.bordered(false)
.cleanable(),
)
.child(
Button::new("add")
.icon(IconName::Plus)
.label("Add")
.tooltip("Add relay")
.ghost()
.size(rems(2.))
.on_click(cx.listener(move |this, _, window, cx| {
this.add(window, cx);
})),
@@ -328,17 +353,25 @@ impl Render for MessagingRelayPanel {
}),
)
.map(|this| {
if !self.relays.is_empty() {
this.child(self.render_list(window, cx))
} else {
if self.relays.is_empty() {
this.child(self.render_empty(window, cx))
} else {
this.child(
v_flex()
.gap_1()
.flex_1()
.w_full()
.children(self.render_list_items(cx)),
)
}
})
.child(divider(cx))
.child(
Button::new("submit")
.label("Update")
.primary()
.small()
.loading(self.updating)
.disabled(self.updating)
.on_click(cx.listener(move |this, _ev, window, cx| {
this.set_relays(window, cx);
})),