1
0

fix: use valid handle format for accounts

This commit is contained in:
2026-03-22 16:30:32 +09:00
parent 80e0c35384
commit 2f96ae9fe3

View File

@@ -398,9 +398,11 @@ fn init_db(conn: &Connection) {
}
fn ensure_account(conn: &Connection, did: &str) {
// handle must be a valid handle format, not a DID
let handle = format!("{}.chat.invalid", did.split(':').last().unwrap_or("unknown"));
conn.execute(
"INSERT OR IGNORE INTO accounts (did, handle, created_at) VALUES (?1, ?2, ?3)",
rusqlite::params![did, did, now_iso()],
rusqlite::params![did, handle, now_iso()],
)
.ok();
}