feat(companion): on-device room login with saved passwords

Log in to a room server from the device UI with no phone app: picking a
room prompts for its password (blank allowed for open rooms), and a
context-menu "Login..." allows re-login. Successful passwords are
persisted to a dedicated /room_pw file so a previously-used room logs
back in after reboot without retyping; a failed login forgets the
(now-stale) saved password so the next attempt prompts again.

The room-password file is written via a temp file + atomic rename
(new DataStore::commitFile helper), matching the crash-safety of
contacts/channels persistence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-26 10:55:24 +02:00
parent 57774d41f3
commit be9f3db8c6
9 changed files with 267 additions and 2 deletions

View File

@@ -176,6 +176,10 @@ File DataStore::openWrite(const char* filename) {
return ::openWrite(_fs, filename);
}
bool DataStore::commitFile(const char* tmp_path, const char* final_path) {
return commitTempFile(_fs, tmp_path, final_path);
}
bool DataStore::removeFile(const char* filename) {
return _fs->remove(filename);
}