feat: add force disconnect handling and improve user ban notifications

This commit is contained in:
HueByte
2026-02-19 22:09:54 +01:00
parent 7a8b5f02d3
commit 107152298e
3 changed files with 47 additions and 7 deletions
@@ -18,6 +18,7 @@ public sealed class EchoHubConnection : IAsyncDisposable
public event Action<string, string?>? OnUserBanned;
public event Action<string, Guid>? OnMessageDeleted;
public event Action<string>? OnChannelNuked;
public event Action<string>? OnForceDisconnect;
public event Action<string>? OnError;
public event Action<string>? OnConnectionStateChanged;
public event Action? OnReconnected;
@@ -105,6 +106,11 @@ public sealed class EchoHubConnection : IAsyncDisposable
OnChannelNuked?.Invoke(channelName);
});
_connection.On<string>(nameof(Core.Contracts.IEchoHubClient.ForceDisconnect), reason =>
{
OnForceDisconnect?.Invoke(reason);
});
_connection.On<string>(nameof(Core.Contracts.IEchoHubClient.Error), message =>
{
OnError?.Invoke(message);