fix: use valid handle format for accounts
This commit is contained in:
@@ -398,9 +398,11 @@ fn init_db(conn: &Connection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn ensure_account(conn: &Connection, did: &str) {
|
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(
|
conn.execute(
|
||||||
"INSERT OR IGNORE INTO accounts (did, handle, created_at) VALUES (?1, ?2, ?3)",
|
"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();
|
.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user