feat: add SMTP email support and fix profile/permissions bugs

This commit is contained in:
root
2026-06-30 19:29:08 +00:00
parent 4ded582dc4
commit f4437c5e1d
26 changed files with 643 additions and 129 deletions
+4 -3
View File
@@ -96,13 +96,14 @@ func (c *Checker) CheckChannelPermission(ctx context.Context, serverID, userID,
}
// Layer channel overrides: apply deny first (subtract), then allow (add).
// Role-based overrides from all user roles, then user-specific override.
// Role-based overrides from all user roles, plus the @everyone role, then user-specific override.
rows, err := c.db.QueryContext(ctx, `
SELECT co.allow_bitflags, co.deny_bitflags
FROM channel_overrides co
WHERE co.channel_id = $1 AND co.target_type = 'role'
AND co.target_id IN (
SELECT mr.role_id FROM member_roles mr WHERE mr.user_id = $2 AND mr.server_id = $3
AND (
co.target_id IN (SELECT mr.role_id FROM member_roles mr WHERE mr.user_id = $2 AND mr.server_id = $3)
OR co.target_id = (SELECT id FROM roles WHERE server_id = $3 AND is_default = TRUE LIMIT 1)
)
`, channelID, userID, serverID)
if err != nil {