diff --git a/Cargo.lock b/Cargo.lock
index a5e8e7c..3ebe66f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1198,7 +1198,7 @@ dependencies = [
[[package]]
name = "collections"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"indexmap",
"rustc-hash 2.1.1",
@@ -1644,7 +1644,7 @@ dependencies = [
[[package]]
name = "derive_refineable"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"proc-macro2",
"quote",
@@ -2599,7 +2599,7 @@ dependencies = [
[[package]]
name = "gpui"
version = "0.2.2"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"async-channel 2.5.0",
@@ -2678,7 +2678,7 @@ dependencies = [
[[package]]
name = "gpui_linux"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"as-raw-xcb-connection",
@@ -2726,7 +2726,7 @@ dependencies = [
[[package]]
name = "gpui_macos"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"async-task",
@@ -2768,7 +2768,7 @@ dependencies = [
[[package]]
name = "gpui_macros"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -2779,7 +2779,7 @@ dependencies = [
[[package]]
name = "gpui_platform"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"console_error_panic_hook",
"gpui",
@@ -2792,7 +2792,7 @@ dependencies = [
[[package]]
name = "gpui_tokio"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"gpui",
@@ -2803,7 +2803,7 @@ dependencies = [
[[package]]
name = "gpui_util"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"log",
@@ -2812,7 +2812,7 @@ dependencies = [
[[package]]
name = "gpui_web"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"console_error_panic_hook",
@@ -2835,7 +2835,7 @@ dependencies = [
[[package]]
name = "gpui_wgpu"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"bytemuck",
@@ -2863,7 +2863,7 @@ dependencies = [
[[package]]
name = "gpui_windows"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"collections",
@@ -3107,7 +3107,7 @@ dependencies = [
[[package]]
name = "http_client"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"async-compression",
@@ -3132,7 +3132,7 @@ dependencies = [
[[package]]
name = "http_client_tls"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"rustls",
"rustls-platform-verifier",
@@ -3668,12 +3668,13 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "libredox"
-version = "0.1.12"
+version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
+checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a"
dependencies = [
"bitflags 2.11.0",
"libc",
+ "plain",
"redox_syscall 0.7.3",
]
@@ -3893,7 +3894,7 @@ dependencies = [
[[package]]
name = "media"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"bindgen",
@@ -4120,7 +4121,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
[[package]]
name = "nostr"
version = "0.44.1"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"aes",
"base64",
@@ -4144,7 +4145,7 @@ dependencies = [
[[package]]
name = "nostr-blossom"
version = "0.44.0"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"base64",
"nostr",
@@ -4155,7 +4156,7 @@ dependencies = [
[[package]]
name = "nostr-connect"
version = "0.44.0"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"async-utility",
"futures-core",
@@ -4168,7 +4169,7 @@ dependencies = [
[[package]]
name = "nostr-database"
version = "0.44.0"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"btreecap",
"flatbuffers",
@@ -4178,7 +4179,7 @@ dependencies = [
[[package]]
name = "nostr-gossip"
version = "0.44.0"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"nostr",
]
@@ -4186,7 +4187,7 @@ dependencies = [
[[package]]
name = "nostr-lmdb"
version = "0.44.0"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"async-utility",
"flume",
@@ -4200,7 +4201,7 @@ dependencies = [
[[package]]
name = "nostr-sdk"
version = "0.44.1"
-source = "git+https://github.com/rust-nostr/nostr#860e239ff894b8471b37c84dcac12b9572b8f064"
+source = "git+https://github.com/rust-nostr/nostr#9bcc6cd779a7c6eb41509b37aee4575fa5ae47b9"
dependencies = [
"async-utility",
"async-wsocket",
@@ -4637,7 +4638,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "perf"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"collections",
"serde",
@@ -4770,6 +4771,12 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
+[[package]]
+name = "plain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+
[[package]]
name = "png"
version = "0.17.16"
@@ -5318,7 +5325,7 @@ dependencies = [
[[package]]
name = "refineable"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"derive_refineable",
]
@@ -5417,7 +5424,7 @@ dependencies = [
[[package]]
name = "reqwest_client"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"bytes",
@@ -5472,7 +5479,7 @@ dependencies = [
[[package]]
name = "rope"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"arrayvec",
"log",
@@ -5734,7 +5741,7 @@ dependencies = [
[[package]]
name = "scheduler"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"async-task",
"backtrace",
@@ -6328,7 +6335,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "sum_tree"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"arrayvec",
"log",
@@ -7271,7 +7278,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "util"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"async-fs",
@@ -7310,7 +7317,7 @@ dependencies = [
[[package]]
name = "util_macros"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"perf",
"quote",
@@ -9113,7 +9120,7 @@ dependencies = [
[[package]]
name = "zlog"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"anyhow",
"chrono",
@@ -9130,7 +9137,7 @@ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
[[package]]
name = "ztracing"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
dependencies = [
"tracing",
"tracing-subscriber",
@@ -9141,7 +9148,7 @@ dependencies = [
[[package]]
name = "ztracing_macro"
version = "0.1.0"
-source = "git+https://github.com/zed-industries/zed#b06522e978b5ed24bcc2cf07a6de794179d69176"
+source = "git+https://github.com/zed-industries/zed#4668aeb7284780cca830ba1173c4d3eb8bd11e2b"
[[package]]
name = "zune-core"
diff --git a/assets/icons/device.svg b/assets/icons/device.svg
new file mode 100644
index 0000000..8c54aef
--- /dev/null
+++ b/assets/icons/device.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/group.svg b/assets/icons/group.svg
new file mode 100644
index 0000000..c150fe3
--- /dev/null
+++ b/assets/icons/group.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/scan.svg b/assets/icons/scan.svg
new file mode 100644
index 0000000..489cb12
--- /dev/null
+++ b/assets/icons/scan.svg
@@ -0,0 +1,3 @@
+
diff --git a/crates/chat/src/lib.rs b/crates/chat/src/lib.rs
index d9971c5..c599c61 100644
--- a/crates/chat/src/lib.rs
+++ b/crates/chat/src/lib.rs
@@ -113,7 +113,7 @@ impl ChatRegistry {
subscriptions.push(
// Observe the nip65 state and load chat rooms on every state change
cx.observe(&nostr, |this, state, cx| {
- match state.read(cx).relay_list_state() {
+ match state.read(cx).relay_list_state {
RelayState::Idle => {
this.reset(cx);
}
@@ -262,9 +262,12 @@ impl ChatRegistry {
pub fn get_contact_list(&mut self, cx: &mut Context) {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
-
let signer = nostr.read(cx).signer();
- let public_key = signer.public_key().unwrap();
+
+ let Some(public_key) = signer.public_key() else {
+ return;
+ };
+
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
let task: Task> = cx.background_spawn(async move {
@@ -318,9 +321,12 @@ impl ChatRegistry {
fn verify_relays(&mut self, cx: &mut Context) -> Task> {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
-
let signer = nostr.read(cx).signer();
- let public_key = signer.public_key().unwrap();
+
+ let Some(public_key) = signer.public_key() else {
+ return Task::ready(Err(anyhow!("User not found")));
+ };
+
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
cx.background_spawn(async move {
@@ -685,14 +691,12 @@ impl ChatRegistry {
}
/// Trigger a refresh of the opened chat rooms by their IDs
- pub fn refresh_rooms(&mut self, ids: Option>, cx: &mut Context) {
- if let Some(ids) = ids {
- for room in self.rooms.iter() {
- if ids.contains(&room.read(cx).id) {
- room.update(cx, |this, cx| {
- this.emit_refresh(cx);
- });
- }
+ pub fn refresh_rooms(&mut self, ids: &[u64], cx: &mut Context) {
+ for room in self.rooms.iter() {
+ if ids.contains(&room.read(cx).id) {
+ room.update(cx, |this, cx| {
+ this.emit_refresh(cx);
+ });
}
}
}
diff --git a/crates/chat/src/room.rs b/crates/chat/src/room.rs
index 97e3a55..af0fdf4 100644
--- a/crates/chat/src/room.rs
+++ b/crates/chat/src/room.rs
@@ -331,7 +331,7 @@ impl Room {
let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
- let sender = signer.public_key().unwrap();
+ let sender = signer.public_key();
// Get room's id
let id = self.id;
@@ -340,7 +340,7 @@ impl Room {
let members: Vec = self
.members
.iter()
- .filter(|public_key| public_key != &&sender)
+ .filter(|public_key| Some(**public_key) != sender)
.copied()
.collect();
diff --git a/crates/chat_ui/src/lib.rs b/crates/chat_ui/src/lib.rs
index e7f078d..975edab 100644
--- a/crates/chat_ui/src/lib.rs
+++ b/crates/chat_ui/src/lib.rs
@@ -876,7 +876,7 @@ impl ChatPanel {
window.open_modal(cx, move |this, _window, cx| {
this.show_close(true)
.title(SharedString::from("Sent Reports"))
- .child(v_flex().pb_4().gap_4().children({
+ .child(v_flex().pb_2().gap_4().children({
let mut items = Vec::with_capacity(reports.len());
for report in reports.iter() {
diff --git a/crates/coop/src/dialogs/accounts.rs b/crates/coop/src/dialogs/accounts.rs
new file mode 100644
index 0000000..b9fe557
--- /dev/null
+++ b/crates/coop/src/dialogs/accounts.rs
@@ -0,0 +1,256 @@
+use anyhow::Error;
+use gpui::prelude::FluentBuilder;
+use gpui::{
+ div, px, App, AppContext, Context, Entity, InteractiveElement, IntoElement, ParentElement,
+ Render, SharedString, StatefulInteractiveElement, Styled, Subscription, Task, Window,
+};
+use nostr_sdk::prelude::*;
+use person::PersonRegistry;
+use state::{NostrRegistry, SignerEvent};
+use theme::ActiveTheme;
+use ui::avatar::Avatar;
+use ui::button::{Button, ButtonVariants};
+use ui::indicator::Indicator;
+use ui::{h_flex, v_flex, Disableable, Icon, IconName, Sizable, WindowExtension};
+
+use crate::dialogs::connect::ConnectSigner;
+use crate::dialogs::import::ImportKey;
+
+pub fn init(window: &mut Window, cx: &mut App) -> Entity {
+ cx.new(|cx| AccountSelector::new(window, cx))
+}
+
+/// Account selector
+pub struct AccountSelector {
+ /// Public key currently being chosen for login
+ logging_in: Entity