mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-06 07:36:01 +02:00
feat: enhance profile editing with avatar support and UI adjustments
- Added AvatarPath to ProfileEditResult for user profile updates. - Updated ProfileEditDialog to include avatar selection with a browse button. - Increased dialog height to accommodate new avatar input fields. - Implemented avatar file path handling in the profile edit dialog. feat: introduce moderation features and user roles - Added ServerRole enum to define user roles (Member, Mod, Admin, Owner). - Extended User model to include role, mute, and ban status. - Created ModerationController for user role assignment, kicking, banning, and muting. - Implemented methods in IChatBroadcaster and SignalRBroadcaster for user moderation actions. - Updated database schema with new columns for user roles and moderation states. fix: ensure muted users cannot send messages - Added mute status checks in ChatService to prevent message sending for muted users. - Updated user presence and status handling to reflect role changes and moderation actions. chore: update constants for ASCII art rendering - Introduced AsciiArtHeightHalfBlock constant for improved ASCII art rendering.
This commit is contained in:
@@ -14,6 +14,10 @@ public sealed class EchoHubConnection : IAsyncDisposable
|
||||
public event Action<string, string>? OnUserLeft;
|
||||
public event Action<ChannelDto>? OnChannelUpdated;
|
||||
public event Action<UserPresenceDto>? OnUserStatusChanged;
|
||||
public event Action<string, string, string?>? OnUserKicked;
|
||||
public event Action<string, string?>? OnUserBanned;
|
||||
public event Action<string, Guid>? OnMessageDeleted;
|
||||
public event Action<string>? OnChannelNuked;
|
||||
public event Action<string>? OnError;
|
||||
public event Action<string>? OnConnectionStateChanged;
|
||||
public event Action? OnReconnected;
|
||||
@@ -81,6 +85,26 @@ public sealed class EchoHubConnection : IAsyncDisposable
|
||||
OnUserStatusChanged?.Invoke(presence);
|
||||
});
|
||||
|
||||
_connection.On<string, string, string?>(nameof(Core.Contracts.IEchoHubClient.UserKicked), (channelName, username, reason) =>
|
||||
{
|
||||
OnUserKicked?.Invoke(channelName, username, reason);
|
||||
});
|
||||
|
||||
_connection.On<string, string?>(nameof(Core.Contracts.IEchoHubClient.UserBanned), (username, reason) =>
|
||||
{
|
||||
OnUserBanned?.Invoke(username, reason);
|
||||
});
|
||||
|
||||
_connection.On<string, Guid>(nameof(Core.Contracts.IEchoHubClient.MessageDeleted), (channelName, messageId) =>
|
||||
{
|
||||
OnMessageDeleted?.Invoke(channelName, messageId);
|
||||
});
|
||||
|
||||
_connection.On<string>(nameof(Core.Contracts.IEchoHubClient.ChannelNuked), channelName =>
|
||||
{
|
||||
OnChannelNuked?.Invoke(channelName);
|
||||
});
|
||||
|
||||
_connection.On<string>(nameof(Core.Contracts.IEchoHubClient.Error), message =>
|
||||
{
|
||||
OnError?.Invoke(message);
|
||||
|
||||
Reference in New Issue
Block a user