mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-05 07:36:03 +02:00
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:
@@ -78,7 +78,8 @@ internal sealed class ConnectionManager : IAsyncDisposable
|
||||
}
|
||||
else if (info.IsRegister)
|
||||
{
|
||||
loginResponse = await _apiClient.RegisterAsync(info.Username, info.Password);
|
||||
loginResponse = await _apiClient.RegisterAsync(
|
||||
info.Username, info.Password, info.DisplayName, info.InviteCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -244,8 +245,8 @@ internal sealed class ConnectionManager : IAsyncDisposable
|
||||
|
||||
// ── Delegate Operations ───────────────────────────────────────────────
|
||||
|
||||
public Task SendMessageAsync(string channel, string content) =>
|
||||
_connection?.SendMessageAsync(channel, content)
|
||||
public Task SendMessageAsync(string channel, string content, Guid? replyToMessageId = null) =>
|
||||
_connection?.SendMessageAsync(channel, content, replyToMessageId)
|
||||
?? throw new InvalidOperationException("Not connected");
|
||||
|
||||
public Task<List<MessageDto>> GetHistoryAsync(string channel, int count = HubConstants.DefaultHistoryCount, int offset = 0) =>
|
||||
|
||||
Reference in New Issue
Block a user