From c21890b55dc5cb08e2b1a51d8d099198933f70bd Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 18 Jan 2025 17:56:15 +0000 Subject: [PATCH] Removing groups from chatters when deleting groups. --- Chat/Groups/ChatterGroupManager.cs | 8 +++++++- OBS/Socket/OBSSocketClient.cs | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Chat/Groups/ChatterGroupManager.cs b/Chat/Groups/ChatterGroupManager.cs index 59c6f63..7cf828e 100644 --- a/Chat/Groups/ChatterGroupManager.cs +++ b/Chat/Groups/ChatterGroupManager.cs @@ -87,7 +87,13 @@ namespace TwitchChatTTS.Chat.Groups public bool Remove(string groupId) { - return _groups.Remove(groupId); + if (_groups.Remove(groupId)) + { + foreach (var entry in _chatters) + entry.Value.Remove(groupId); + return true; + } + return false; } public bool Remove(long chatterId, string groupId) diff --git a/OBS/Socket/OBSSocketClient.cs b/OBS/Socket/OBSSocketClient.cs index ac004f9..bc1e7b5 100644 --- a/OBS/Socket/OBSSocketClient.cs +++ b/OBS/Socket/OBSSocketClient.cs @@ -5,8 +5,6 @@ using Serilog; using System.Text.Json; using System.Collections.Concurrent; using TwitchChatTTS.OBS.Socket.Data; -using System.Timers; -using System.Net.WebSockets; using CommonSocketLibrary.Backoff; namespace TwitchChatTTS.OBS.Socket