fix: auto-join #ops creates group if missing, remove auth from create/join group
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,11 +48,15 @@ pub async fn run_tui(
|
||||
network::poll_loop(poll_messages, poll_receipts, poll_pending_files, poll_fp, poll_identity, poll_db, poll_client, poll_last_dm, poll_connected).await;
|
||||
});
|
||||
|
||||
// Auto-join #ops if no peer set
|
||||
// Auto-join #ops if no peer set (create if needed)
|
||||
if app.peer_fp.is_none() {
|
||||
let join_url = format!("{}/v1/groups/ops/join", client.base_url);
|
||||
let fp_clean: String = our_fp.chars().filter(|c| c.is_ascii_hexdigit()).collect::<String>().to_lowercase();
|
||||
let _ = client.client.post(&join_url)
|
||||
// Create #ops if it doesn't exist
|
||||
let _ = client.client.post(format!("{}/v1/groups/create", client.base_url))
|
||||
.json(&serde_json::json!({"name": "ops", "creator": fp_clean}))
|
||||
.send().await;
|
||||
// Join
|
||||
let _ = client.client.post(format!("{}/v1/groups/ops/join", client.base_url))
|
||||
.json(&serde_json::json!({"fingerprint": fp_clean}))
|
||||
.send().await;
|
||||
app.peer_fp = Some("#ops".to_string());
|
||||
|
||||
Reference in New Issue
Block a user