mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 16:46:08 +02:00
feat: add force disconnect handling and improve user ban notifications
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user