Skip to content

feat: group invite links, and make Add participants work (0.8.0, qc 0.7.0) - #306

Merged
ralyodio merged 2 commits into
masterfrom
fix/group-invite-codes
Oct 11, 2026
Merged

ralyodio merged 2 commits into
masterfrom
fix/group-invite-codes

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Fixes the group invite gap documented in #305, plus two bugs found on the way.

Was broken

  • The Join Group modal ("group code or invite link") was never mounted, and its {code} request was not understood by /api/conversations/join. Group chats had no invite mechanism at all.
  • POST /api/chat/conversations/[id]/participants did not exist, so Add participants silently got a 405.
  • The chat header's currentConversation was never set: the title was always "Chat" and the Add participants button never appeared.

Now

  • Group admins get one invite link per group from a new Invite link button in the header: create, copy, reset (the old link dies), turn off, with a use count.
  • /join/<code> shows the group name and member count, then joins it. If you are signed out, it keeps the code and /chat joins the group after any sign-in method (passkey, SMS, CoinPay, anonymous).
  • /api/conversations/join accepts { code } (a bare code or a link). A Join button in the sidebar opens the modal.
  • Add participants works for group admins. It brings back people who left and never demotes an admin.
  • qc join <link> and qc invite <chat> [--reset|--off].
  • docs/INVITES.md is updated.

People who join read messages sent from then on; senders already encrypt each message to whoever is in the chat when it is sent.

Migration: 20261011000000_conversation_invites.sql adds an additive table that only the service role can access. Apply it on dev2 by hand before deploying.

Checks: 733/733 vitest (new group-invites.test.js with an in-memory DB), next build passes, qc bundle builds, and qc --help lists the new commands.

🤖 Generated with Claude Code

ralyodio and others added 2 commits October 11, 2026 09:43
- Group admins get one invite link per group (https://qrypt.chat/join/<code>):
  create, copy, reset, turn off. /join/<code> previews the group and joins it;
  signed out, it keeps the code and /chat joins after any sign-in.
- /api/conversations/join accepts { code } (a code or a link); the sidebar's
  new Join button opens the Join Group modal, which was never mounted.
- POST /api/chat/conversations/[id]/participants did not exist, so Add
  participants silently 405'd; it now adds people (group admins only).
- The chat header never knew the current conversation (always "Chat", Add
  participants never shown): derive it from the sidebar's list, with my_role.
- qc join <link> and qc invite <chat> [--reset|--off].
- Migration 20261011000000_conversation_invites (service role only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio ralyodio changed the title feat: group invite links, and make Add participants work feat: group invite links, and make Add participants work (0.8.0, qc 0.7.0) Oct 11, 2026
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

13 finding(s)

MEDIUM: 9 | LOW: 4

Severity Rule Location
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.jsx:38
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.jsx:66
MEDIUM js-unescaped-html-sink src/app/faq/page.jsx:57
MEDIUM js-unescaped-html-sink src/app/layout.jsx:141
MEDIUM js-unescaped-html-sink src/app/layout.jsx:145
MEDIUM js-unescaped-html-sink src/app/page.jsx:47
MEDIUM redos-nested-quantifier src/lib/auth/dns-name.js:88
MEDIUM js-unescaped-html-sink src/lib/components/chat/MessageItem.jsx:85
MEDIUM js-unescaped-html-sink src/lib/components/chat/MessageItem.jsx:130
LOW secret-generic-credential src/app/api/auth/register-anon/route.test.js:32
LOW secret-jwt tests/debug-sms.js:10
LOW secret-generic-credential tests/private-key-import-export.test.js:252
LOW secret-generic-credential tests/private-key-import-export.test.js:264

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 9f3257e into master Oct 11, 2026
11 checks passed
@ralyodio
ralyodio deleted the fix/group-invite-codes branch October 11, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant