feat: allow any group DM member to add friends, not just owner

Remove the owner-only gate on POST /api/dm/:id/members. The S2S relay
already accepts member_add from any HMAC-verified peer, and the UI
already shows the add button to all group DM members. Only the
server-side check was blocking non-owners.
This commit is contained in:
Jannis Braun
2026-04-09 02:15:44 +02:00
parent 016ca2c59b
commit ce0b2d0e15
2 changed files with 7 additions and 10 deletions
+1 -3
View File
@@ -902,9 +902,7 @@ export async function dmRoutes(app: FastifyInstance): Promise<void> {
if (!dmChannel.ownerId) {
return reply.code(400).send({ error: 'Cannot add members to a 1-on-1 DM. Use POST /api/dm/group to create a group.', statusCode: 400 });
}
if (dmChannel.ownerId !== request.userId) {
return reply.code(403).send({ error: 'Only the group owner can add members', statusCode: 403 });
}
// Any group DM member can add friends (not just the owner)
// Validate the adder and target are friends
const friendship = db.select().from(schema.friends).where(