diff --git a/Cargo.lock b/Cargo.lock
index c9d548d8bd9ead089d69426ba8a7009ed3f16dbe..57dcade5b9a1a63c3d85c9535e0671c2fbd70d57 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -841,6 +841,7 @@ dependencies = [
"async-tungstenite",
"axum",
"base64 0.13.0",
+ "clap 3.1.12",
"client",
"collections",
"ctor",
@@ -859,6 +860,7 @@ dependencies = [
"parking_lot",
"project",
"rand 0.8.3",
+ "reqwest",
"rpc",
"scrypt",
"serde",
@@ -930,10 +932,17 @@ name = "contacts_panel"
version = "0.1.0"
dependencies = [
"client",
+ "editor",
+ "futures",
+ "fuzzy",
"gpui",
+ "log",
+ "picker",
"postage",
+ "serde",
"settings",
"theme",
+ "util",
"workspace",
]
@@ -2133,6 +2142,19 @@ dependencies = [
"tokio-io-timeout",
]
+[[package]]
+name = "hyper-tls"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
+dependencies = [
+ "bytes",
+ "hyper",
+ "native-tls",
+ "tokio",
+ "tokio-native-tls",
+]
+
[[package]]
name = "idna"
version = "0.2.3"
@@ -2237,6 +2259,12 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "ipnet"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b"
+
[[package]]
name = "isahc"
version = "1.7.0"
@@ -2720,6 +2748,24 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
+[[package]]
+name = "native-tls"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9"
+dependencies = [
+ "lazy_static",
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
[[package]]
name = "nb-connect"
version = "1.0.3"
@@ -2903,6 +2949,32 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+[[package]]
+name = "openssl"
+version = "0.10.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e"
+dependencies = [
+ "bitflags",
+ "cfg-if 1.0.0",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "openssl-probe"
version = "0.1.4"
@@ -2911,9 +2983,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
[[package]]
name = "openssl-sys"
-version = "0.9.65"
+version = "0.9.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d"
+checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0"
dependencies = [
"autocfg 1.0.1",
"cc",
@@ -3677,6 +3749,42 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "reqwest"
+version = "0.11.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525"
+dependencies = [
+ "base64 0.13.0",
+ "bytes",
+ "encoding_rs",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "hyper",
+ "hyper-tls",
+ "ipnet",
+ "js-sys",
+ "lazy_static",
+ "log",
+ "mime",
+ "native-tls",
+ "percent-encoding",
+ "pin-project-lite 0.2.9",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "tokio",
+ "tokio-native-tls",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "winreg",
+]
+
[[package]]
name = "resvg"
version = "0.14.0"
@@ -4957,6 +5065,16 @@ dependencies = [
"syn",
]
+[[package]]
+name = "tokio-native-tls"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
+dependencies = [
+ "native-tls",
+ "tokio",
+]
+
[[package]]
name = "tokio-rustls"
version = "0.22.0"
@@ -5632,6 +5750,18 @@ dependencies = [
"wasm-bindgen-shared",
]
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1"
+dependencies = [
+ "cfg-if 1.0.0",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.74"
@@ -5777,6 +5907,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+[[package]]
+name = "winreg"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
+dependencies = [
+ "winapi 0.3.9",
+]
+
[[package]]
name = "wio"
version = "0.2.2"
diff --git a/assets/icons/accept.svg b/assets/icons/accept.svg
new file mode 100644
index 0000000000000000000000000000000000000000..6a8a7d67a08a3215966942430fe0d528374eee82
--- /dev/null
+++ b/assets/icons/accept.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/add-contact.svg b/assets/icons/add-contact.svg
new file mode 100644
index 0000000000000000000000000000000000000000..4fc7790b9dc0d204997cff308d93d2bf4497c678
--- /dev/null
+++ b/assets/icons/add-contact.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/reject.svg b/assets/icons/reject.svg
new file mode 100644
index 0000000000000000000000000000000000000000..e78f49a22894055f22cf5af1fede318e50af8963
--- /dev/null
+++ b/assets/icons/reject.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/themes/cave-dark.json b/assets/themes/cave-dark.json
index 3b19c2e63eef855981632972fe933324dd677902..cb1208a1db764bbb540dc73540eb723bfded2d91 100644
--- a/assets/themes/cave-dark.json
+++ b/assets/themes/cave-dark.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#19171c",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#e2dfe7",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#7e7887",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#576ddb",
+ "selection": "#576ddb3d"
+ },
+ "border": {
+ "color": "#26232a",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#e2dfe7",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#8b8792",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#655f6d",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#e2dfe7",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#26232a",
+ "color": "#e2dfe7",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#5852603d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#26232a",
+ "color": "#8b8792",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#26232a",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#8b8792",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#576ddb",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#5852605c",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#e2dfe7",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#5852603d"
+ }
+ },
+ "border": {
+ "color": "#19171c",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#7e7887",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#19171c",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#7e7887",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#576ddb",
+ "selection": "#576ddb3d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#e2dfe7",
+ "size": 14
+ },
+ "border": {
+ "color": "#26232a",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000003d",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#26232a",
+ "color": "#e2dfe7",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#5852603d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#26232a",
+ "color": "#8b8792",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#955ae77a",
"tab_icon_spacing": 8,
diff --git a/assets/themes/cave-light.json b/assets/themes/cave-light.json
index 2e33fb774fe95b06c4da7d8d7d6209c20673b592..f0b3f5bd438a53178d9f56f88e8fbf1dbd41472d 100644
--- a/assets/themes/cave-light.json
+++ b/assets/themes/cave-light.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#efecf4",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#26232a",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#655f6d",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#576ddb",
+ "selection": "#576ddb3d"
+ },
+ "border": {
+ "color": "#e2dfe7",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#26232a",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#585260",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#7e7887",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#26232a",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#e2dfe7",
+ "color": "#26232a",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#8b87921f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#e2dfe7",
+ "color": "#585260",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#e2dfe7",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#585260",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#576ddb",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#8b87922e",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#26232a",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#8b87921f"
+ }
+ },
+ "border": {
+ "color": "#efecf4",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#655f6d",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#efecf4",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#655f6d",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#576ddb",
+ "selection": "#576ddb3d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#26232a",
+ "size": 14
+ },
+ "border": {
+ "color": "#e2dfe7",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000001f",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#e2dfe7",
+ "color": "#26232a",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#8b87921f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#e2dfe7",
+ "color": "#585260",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#955ae73d",
"tab_icon_spacing": 8,
diff --git a/assets/themes/dark.json b/assets/themes/dark.json
index ba9b7189d35fada8abcc2b42bace6c9f5a81fd19..9cc3badc8104dbee88d2862ad7feeedba22383e8 100644
--- a/assets/themes/dark.json
+++ b/assets/themes/dark.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#000000",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#f1f1f1",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#474747",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#2472f2",
+ "selection": "#2472f23d"
+ },
+ "border": {
+ "color": "#232323",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#c6c6c6",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#9c9c9c",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#404040",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#f1f1f1",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#2b2b2b",
+ "color": "#c6c6c6",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#323232"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#2b2b2b",
+ "color": "#555555",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#1c1c1c",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#9c9c9c",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#4f8ff7",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#2b2b2b",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#f1f1f1",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#232323"
+ }
+ },
+ "border": {
+ "color": "#070707",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#474747",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#000000",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#474747",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#2472f2",
+ "selection": "#2472f23d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#f1f1f1",
+ "size": 14
+ },
+ "border": {
+ "color": "#232323",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#00000052",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#2b2b2b",
+ "color": "#c6c6c6",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#323232"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#2b2b2b",
+ "color": "#555555",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#3f15a380",
"tab_icon_spacing": 8,
diff --git a/assets/themes/light.json b/assets/themes/light.json
index 7cbd315c8a41ff3572cb414727618607ae3e8875..e2563fadad64d74d0b7add301cbfb2fc0969be6d 100644
--- a/assets/themes/light.json
+++ b/assets/themes/light.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#ffffff",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#2b2b2b",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#808080",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#2472f2",
+ "selection": "#2472f23d"
+ },
+ "border": {
+ "color": "#d5d5d5",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#393939",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#474747",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#e3e3e3",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#2b2b2b",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#eaeaea",
+ "color": "#393939",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#e3e3e3"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#eaeaea",
+ "color": "#9c9c9c",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#f8f8f8",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#474747",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#484bed",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#e3e3e3",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#2b2b2b",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#eaeaea"
+ }
+ },
+ "border": {
+ "color": "#d5d5d5",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#808080",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#ffffff",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#808080",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#2472f2",
+ "selection": "#2472f23d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#2b2b2b",
+ "size": 14
+ },
+ "border": {
+ "color": "#d5d5d5",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000001f",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#eaeaea",
+ "color": "#393939",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#e3e3e3"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#eaeaea",
+ "color": "#9c9c9c",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#fce9b7",
"tab_icon_spacing": 8,
diff --git a/assets/themes/solarized-dark.json b/assets/themes/solarized-dark.json
index 8672518b4cf3ef8a93cc9ad4793a6ba0106c2faa..6e8c405b6c212bf77fc99c99ea3c2a6dcf5a2f07 100644
--- a/assets/themes/solarized-dark.json
+++ b/assets/themes/solarized-dark.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#002b36",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#eee8d5",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#839496",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#268bd2",
+ "selection": "#268bd23d"
+ },
+ "border": {
+ "color": "#073642",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#eee8d5",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#93a1a1",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#657b83",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#eee8d5",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#073642",
+ "color": "#eee8d5",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#586e753d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#073642",
+ "color": "#93a1a1",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#073642",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#93a1a1",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#268bd2",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#586e755c",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#eee8d5",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#586e753d"
+ }
+ },
+ "border": {
+ "color": "#002b36",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#839496",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#002b36",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#839496",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#268bd2",
+ "selection": "#268bd23d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#eee8d5",
+ "size": 14
+ },
+ "border": {
+ "color": "#073642",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000003d",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#073642",
+ "color": "#eee8d5",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#586e753d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#073642",
+ "color": "#93a1a1",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#6c71c47a",
"tab_icon_spacing": 8,
diff --git a/assets/themes/solarized-light.json b/assets/themes/solarized-light.json
index 66b43e613dc725687d3f34c3ab427d7a1311ae61..3f5b26ee56a24a883fc21c45a9de60bec20b9a5d 100644
--- a/assets/themes/solarized-light.json
+++ b/assets/themes/solarized-light.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#fdf6e3",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#073642",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#657b83",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#268bd2",
+ "selection": "#268bd23d"
+ },
+ "border": {
+ "color": "#eee8d5",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#073642",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#586e75",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#839496",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#073642",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#eee8d5",
+ "color": "#073642",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#93a1a11f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#eee8d5",
+ "color": "#586e75",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#eee8d5",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#586e75",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#268bd2",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#93a1a12e",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#073642",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#93a1a11f"
+ }
+ },
+ "border": {
+ "color": "#fdf6e3",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#657b83",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#fdf6e3",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#657b83",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#268bd2",
+ "selection": "#268bd23d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#073642",
+ "size": 14
+ },
+ "border": {
+ "color": "#eee8d5",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000001f",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#eee8d5",
+ "color": "#073642",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#93a1a11f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#eee8d5",
+ "color": "#586e75",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#6c71c43d",
"tab_icon_spacing": 8,
diff --git a/assets/themes/sulphurpool-dark.json b/assets/themes/sulphurpool-dark.json
index 66f5182172e01e14902e28566600bbd7084de1de..0f2a868f24d028be4c960db27b39b36b540a3e5d 100644
--- a/assets/themes/sulphurpool-dark.json
+++ b/assets/themes/sulphurpool-dark.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#202746",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#dfe2f1",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#898ea4",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#3d8fd1",
+ "selection": "#3d8fd13d"
+ },
+ "border": {
+ "color": "#293256",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#dfe2f1",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#979db4",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#6b7394",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#dfe2f1",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#293256",
+ "color": "#dfe2f1",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#5e66873d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#293256",
+ "color": "#979db4",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#293256",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#979db4",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#3d8fd1",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#5e66875c",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#dfe2f1",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#5e66873d"
+ }
+ },
+ "border": {
+ "color": "#202746",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#898ea4",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#202746",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#898ea4",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#3d8fd1",
+ "selection": "#3d8fd13d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#dfe2f1",
+ "size": 14
+ },
+ "border": {
+ "color": "#293256",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000003d",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#293256",
+ "color": "#dfe2f1",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#5e66873d"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#293256",
+ "color": "#979db4",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#6679cc7a",
"tab_icon_spacing": 8,
diff --git a/assets/themes/sulphurpool-light.json b/assets/themes/sulphurpool-light.json
index 34a33897288143e9e5c8492d5c753232ac1422b9..b9106c62f3d273a537616f0cbd38090b8c854411 100644
--- a/assets/themes/sulphurpool-light.json
+++ b/assets/themes/sulphurpool-light.json
@@ -1212,14 +1212,64 @@
"bottom": 12,
"right": 12
},
- "host_row_height": 28,
+ "user_query_editor": {
+ "background": "#f5f7ff",
+ "corner_radius": 6,
+ "text": {
+ "family": "Zed Mono",
+ "color": "#293256",
+ "size": 14
+ },
+ "placeholder_text": {
+ "family": "Zed Mono",
+ "color": "#6b7394",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#3d8fd1",
+ "selection": "#3d8fd13d"
+ },
+ "border": {
+ "color": "#dfe2f1",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 8,
+ "right": 8,
+ "top": 4
+ }
+ },
+ "user_query_editor_height": 32,
+ "add_contact_button": {
+ "margin": {
+ "left": 6
+ },
+ "color": "#293256",
+ "button_width": 8,
+ "icon_width": 8
+ },
+ "row": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "row_height": 28,
+ "header": {
+ "family": "Zed Mono",
+ "color": "#5e6687",
+ "size": 14,
+ "margin": {
+ "top": 8
+ }
+ },
"tree_branch_color": "#898ea4",
"tree_branch_width": 1,
- "host_avatar": {
+ "contact_avatar": {
"corner_radius": 10,
"width": 18
},
- "host_username": {
+ "contact_username": {
"family": "Zed Mono",
"color": "#293256",
"size": 14,
@@ -1227,6 +1277,23 @@
"left": 8
}
},
+ "contact_button": {
+ "background": "#dfe2f1",
+ "color": "#293256",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#979db41f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#dfe2f1",
+ "color": "#5e6687",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ },
"project": {
"guest_avatar_spacing": 4,
"height": 24,
@@ -1328,6 +1395,122 @@
"corner_radius": 6
}
},
+ "contact_finder": {
+ "background": "#dfe2f1",
+ "corner_radius": 8,
+ "padding": 8,
+ "item": {
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 4
+ },
+ "corner_radius": 8,
+ "text": {
+ "family": "Zed Sans",
+ "color": "#5e6687",
+ "size": 14
+ },
+ "highlight_text": {
+ "family": "Zed Sans",
+ "color": "#3d8fd1",
+ "weight": "bold",
+ "size": 14
+ },
+ "active": {
+ "background": "#979db42e",
+ "text": {
+ "family": "Zed Sans",
+ "color": "#293256",
+ "size": 14
+ }
+ },
+ "hover": {
+ "background": "#979db41f"
+ }
+ },
+ "border": {
+ "color": "#f5f7ff",
+ "width": 1
+ },
+ "empty": {
+ "text": {
+ "family": "Zed Sans",
+ "color": "#6b7394",
+ "size": 14
+ },
+ "padding": {
+ "bottom": 4,
+ "left": 12,
+ "right": 12,
+ "top": 8
+ }
+ },
+ "input_editor": {
+ "background": "#f5f7ff",
+ "corner_radius": 8,
+ "placeholder_text": {
+ "family": "Zed Sans",
+ "color": "#6b7394",
+ "size": 14
+ },
+ "selection": {
+ "cursor": "#3d8fd1",
+ "selection": "#3d8fd13d"
+ },
+ "text": {
+ "family": "Zed Mono",
+ "color": "#293256",
+ "size": 14
+ },
+ "border": {
+ "color": "#dfe2f1",
+ "width": 1
+ },
+ "padding": {
+ "bottom": 7,
+ "left": 16,
+ "right": 16,
+ "top": 7
+ }
+ },
+ "shadow": {
+ "blur": 16,
+ "color": "#0000001f",
+ "offset": [
+ 0,
+ 2
+ ]
+ },
+ "row_height": 28,
+ "contact_avatar": {
+ "corner_radius": 10,
+ "width": 18
+ },
+ "contact_username": {
+ "padding": {
+ "left": 8
+ }
+ },
+ "contact_button": {
+ "background": "#dfe2f1",
+ "color": "#293256",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8,
+ "hover": {
+ "background": "#979db41f"
+ }
+ },
+ "disabled_contact_button": {
+ "background": "#dfe2f1",
+ "color": "#5e6687",
+ "icon_width": 8,
+ "button_width": 16,
+ "corner_radius": 8
+ }
+ },
"search": {
"match_background": "#6679cc3d",
"tab_icon_spacing": 8,
diff --git a/crates/client/src/channel.rs b/crates/client/src/channel.rs
index 51d4007ff75dc546008dbc8e1ca8ac33e9d2ff5c..0d44c6719139d3b4ed1344295841480f6df2f1f9 100644
--- a/crates/client/src/channel.rs
+++ b/crates/client/src/channel.rs
@@ -500,7 +500,7 @@ async fn messages_from_proto(
.collect();
user_store
.update(cx, |user_store, cx| {
- user_store.load_users(unique_user_ids, cx)
+ user_store.get_users(unique_user_ids, cx)
})
.await?;
@@ -639,7 +639,7 @@ mod tests {
server
.respond(
get_users.receipt(),
- proto::GetUsersResponse {
+ proto::UsersResponse {
users: vec![proto::User {
id: 5,
github_login: "nathansobo".into(),
@@ -690,7 +690,7 @@ mod tests {
server
.respond(
get_users.receipt(),
- proto::GetUsersResponse {
+ proto::UsersResponse {
users: vec![proto::User {
id: 6,
github_login: "maxbrunsfeld".into(),
@@ -738,7 +738,7 @@ mod tests {
server
.respond(
get_users.receipt(),
- proto::GetUsersResponse {
+ proto::UsersResponse {
users: vec![proto::User {
id: 7,
github_login: "as-cii".into(),
diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index e6fc1bf19ad5fe0a886f1e077fdb335af19e5f40..75d5b459e134d97b61d01e949e164ab80baf9d89 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -117,7 +117,7 @@ impl EstablishConnectionError {
}
}
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Status {
SignedOut,
UpgradeRequired,
@@ -293,6 +293,7 @@ impl Client {
}
fn set_status(self: &Arc, status: Status, cx: &AsyncAppContext) {
+ log::info!("set status on client {}: {:?}", self.id, status);
let mut state = self.state.write();
*state.status.0.borrow_mut() = status;
@@ -629,10 +630,13 @@ impl Client {
async fn set_connection(self: &Arc, conn: Connection, cx: &AsyncAppContext) {
let executor = cx.background();
+ log::info!("add connection to peer");
let (connection_id, handle_io, mut incoming) = self
.peer
.add_connection(conn, move |duration| executor.timer(duration))
.await;
+ log::info!("set status to connected {}", connection_id);
+ self.set_status(Status::Connected { connection_id }, cx);
cx.foreground()
.spawn({
let cx = cx.clone();
@@ -730,15 +734,17 @@ impl Client {
})
.detach();
- self.set_status(Status::Connected { connection_id }, cx);
-
let handle_io = cx.background().spawn(handle_io);
let this = self.clone();
let cx = cx.clone();
cx.foreground()
.spawn(async move {
match handle_io.await {
- Ok(()) => this.set_status(Status::SignedOut, &cx),
+ Ok(()) => {
+ if *this.status().borrow() == (Status::Connected { connection_id }) {
+ this.set_status(Status::SignedOut, &cx);
+ }
+ }
Err(err) => {
log::error!("connection error: {:?}", err);
this.set_status(Status::ConnectionLost, &cx);
diff --git a/crates/client/src/user.rs b/crates/client/src/user.rs
index c8432d92d1ff38c66550ee69b997e0cc2748d8af..1874822774a36ef2c7c777bd5e7d91f2d5e72b71 100644
--- a/crates/client/src/user.rs
+++ b/crates/client/src/user.rs
@@ -1,10 +1,11 @@
use super::{http::HttpClient, proto, Client, Status, TypedEnvelope};
-use anyhow::{anyhow, Result};
-use futures::{future, AsyncReadExt};
+use anyhow::{anyhow, Context, Result};
+use futures::{channel::mpsc, future, AsyncReadExt, Future, StreamExt};
use gpui::{AsyncAppContext, Entity, ImageData, ModelContext, ModelHandle, Task};
use postage::{prelude::Stream, sink::Sink, watch};
+use rpc::proto::{RequestMessage, UsersResponse};
use std::{
- collections::{HashMap, HashSet},
+ collections::{hash_map::Entry, HashMap, HashSet},
sync::{Arc, Weak},
};
use util::TryFutureExt as _;
@@ -19,6 +20,7 @@ pub struct User {
#[derive(Debug)]
pub struct Contact {
pub user: Arc,
+ pub online: bool,
pub projects: Vec,
}
@@ -30,11 +32,22 @@ pub struct ProjectMetadata {
pub guests: Vec>,
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ContactRequestStatus {
+ None,
+ RequestSent,
+ RequestReceived,
+ RequestAccepted,
+}
+
pub struct UserStore {
users: HashMap>,
- update_contacts_tx: watch::Sender