feat: direct messages & private channels, server side (#114) #115
No reviewers
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom!115
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/114-direct-messages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements Phases 1–4 of #114 (server side). Phases 5 (private calls, blocked on the SFU work in #22–#24) and 6 (client UX) are follow-ups; this PR does not close the issue.
Summary
Private 1:1 DMs and group DMs as access-controlled channels: a
channel_memberspubkey ACL on ordinary channels, newdm/group_dmchannel types,/api/v1/dms+/api/v1/group-dmsendpoints, and ACL-gated message access and gateway delivery.Changes
channelswithchannel_type+dm_key(canonical sorted-pubkey pair, unique, makes 1:1 opens idempotent) and adds thechannel_membersACL table (keyed on pubkey so DMs survive leave/rejoin). NewPrivateChannelStoretrait + SQLite impl. Public channel-name uniqueness became a partial index — private channels are unnamed/duplicable.features.direct_messages(default on),membership.require_invite_for_dm(default on: DM targets must be server members),content.allow_group_dms(default on),content.max_group_dm_members(default 10).POST/GET /api/v1/dms,POST /api/v1/group-dms,POST /group-dms/{id}/members,DELETE /group-dms/{id}/members/{pubkey}. Existing message/reaction/thread/attachment endpoints work in private channels via theChannelMemberextractor, which now grants a fixed permission set to ACL members and 404s non-members (existence not revealed).GET /channels, the gateway HELLO channel list, and the public/channels/{id}get/update/delete surface.DM_CHANNEL_CREATE/DM_CHANNEL_MEMBER_ADD/DM_CHANNEL_MEMBER_REMOVEevents, delivered per-user to ACL members; bot-sdk gets matching typed events/handlers.Decisions on open questions (adjust if you disagree)
require_invite_for_dm= “target must be a current server member”; when off, any valid pubkey can be in an ACL and sees the channel if they join.created_byis stored). A group DM whose last member leaves is deleted.Testing
cargo test --workspace: all green;cargo clippy --workspace --all-targets -- -D warnings: clean🤖 Generated with Claude Code
Phase 6 (client UX) is now included in this PR (commit
f27337c):+button opening a member picker that opens a DM (one selection) or creates a group DM with an optional name (multiple selections).DM_CHANNEL_CREATE/DM_CHANNEL_MEMBER_ADD/DM_CHANNEL_MEMBER_REMOVEupdate the store live; messages in private channels reuse the existing message flow.GET /dms(feature disabled) hides all DM UI.Testing: 104 client tests pass (10 new: DM gateway event handling, DM label derivation, Message menu item),
tsc --noEmitandpnpm lintclean; server suite unchanged and green.Not done from the Phase 6 punchlist: profile/mention start-DM entry points (the profile popover component is currently unwired in the app) and the private-call UI (blocked on Phase 5 / SFU).