Fixed 7tv & Twitch reconnection. Added adbreak, follow, subscription handlers for Twitch. Added multi-chat support. Added support to unsubscribe from Twitch event subs.

This commit is contained in:
Tom
2024-08-06 19:29:29 +00:00
parent 75fcb8e0f8
commit 8014c12bc5
60 changed files with 1064 additions and 672 deletions

View File

@ -23,6 +23,13 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
return res;
}
public bool? CheckIfDirectAllowed(string path)
{
var res = Get(path)?.DirectAllow;
_logger.Debug($"Permission Node GET {path} = {res?.ToString() ?? "null"} [direct]");
return res;
}
public bool? CheckIfAllowed(IEnumerable<string> groups, string path)
{
bool overall = false;
@ -37,6 +44,20 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
return overall ? true : null;
}
public bool? CheckIfDirectAllowed(IEnumerable<string> groups, string path)
{
bool overall = false;
foreach (var group in groups)
{
var result = CheckIfDirectAllowed($"{group}.{path}");
if (result == false)
return false;
if (result == true)
overall = true;
}
return overall ? true : null;
}
public void Clear()
{
_root.Clear();
@ -104,6 +125,7 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
}
set => _allow = value;
}
public bool? DirectAllow { get => _allow; }
internal PermissionNode? Parent { get => _parent; }
public IList<PermissionNode>? Children { get => _children == null ? null : new ReadOnlyCollection<PermissionNode>(_children); }

View File

@ -5,6 +5,8 @@ namespace TwitchChatTTS.Chat.Groups.Permissions
void Set(string path, bool? allow);
bool? CheckIfAllowed(string path);
bool? CheckIfAllowed(IEnumerable<string> groups, string path);
bool? CheckIfDirectAllowed(string path);
bool? CheckIfDirectAllowed(IEnumerable<string> groups, string path);
void Clear();
bool Remove(string path);
}