feat/profile-privacy #49

Merged
nrupard merged 2 commits from feat/profile-privacy into main 2026-05-06 18:26:47 +02:00
Owner
No description provided.
Adds an `is_profile_public` flag (default true) on users. When a user marks their profile private via Settings, they no longer appear in `/users/search` results to anyone but themselves, and other users cannot start a brand-new DM with them; existing DMs continue to work so prior conversations are not orphaned.

- New auth migration `0005_profile_visibility.sql` adds the column with default 1.
- `db::auth::search_users` now takes a `viewer_id` and filters `is_profile_public = 1 OR id = viewer_id` so the viewer can still find themselves.
- `db::auth::set_profile_public` is the setter used by the settings handler.
- `routes/dm::get_dm` returns 404 when no prior DM exists with a private peer, matching how unknown users surface.
- Settings page exposes a "Public profile" checkbox in the Preferences form.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Opening a DM with a private profile now renders the Home page with a red error bubble explaining the situation, matching how enclave permission errors surface. Previously the handler returned `AppError::NotFound`, which hit the bare 404 fallback and gave no context.

- WelcomePage gains an optional `flash_error` field; the welcome template renders it as the standard red bubble used elsewhere.
- get_dm builds a WelcomePage with the flash text when a private peer has no prior DM, instead of returning NotFound.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch feat/profile-privacy 2026-05-06 18:26:47 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!49
No description provided.