mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-06 23:34:13 +02:00
feat: implement notification sound functionality with user customization options
This commit is contained in:
@@ -106,4 +106,22 @@ public class IrcBroadcaster : IChatBroadcaster
|
||||
await conn.SendAsync($":{_gateway.Options.ServerName} NOTICE {conn.Nickname ?? "*"} :{message}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ForceDisconnectUserAsync(List<string> connectionIds, string reason)
|
||||
{
|
||||
foreach (var connId in connectionIds)
|
||||
{
|
||||
if (!connId.StartsWith("irc-")) continue;
|
||||
|
||||
if (_gateway.Connections.TryGetValue(connId, out var conn))
|
||||
{
|
||||
try
|
||||
{
|
||||
await conn.SendAsync($"ERROR :Closing Link: {reason}");
|
||||
await conn.DisposeAsync();
|
||||
}
|
||||
catch { /* connection may already be closed */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user