feat: Add invite codes and message replies functionality

- Introduced a new migration to add InviteCodes table and ReplyToMessageId column in Messages.
- Updated ChatHub to support replying to messages.
- Enhanced ChatService to handle message replies and validate reply targets.
- Modified UserService to implement invite-only registration mode with invite code consumption.
- Added configuration options for registration modes in appsettings.
- Created unit tests for new features including invite code registration and message reply formatting.
This commit is contained in:
HueByte
2026-07-17 19:47:57 +02:00
parent bb987dda82
commit 3281064720
44 changed files with 2484 additions and 74 deletions
@@ -31,11 +31,19 @@ public class ServerController : ControllerBase
var userCount = await _db.Users.CountAsync();
var channelCount = await _db.Channels.CountAsync();
var registrationMode = (_config["Server:Registration"] ?? "open").Trim().ToLowerInvariant() switch
{
"invite" => "invite",
"closed" => "closed",
_ => "open",
};
var status = new ServerStatusDto(
_config["Server:Name"] ?? "EchoHub Server",
_config["Server:Description"],
userCount,
channelCount);
channelCount,
registrationMode);
return Ok(status);
}