Added checks for non-user foreign keys in stores. Load/Saving stores' order is now based on table dependencies. Added ability to use chat message when using redemption.

This commit is contained in:
Tom
2025-01-28 19:12:14 +00:00
parent 6d955f245a
commit 3e717522c2
18 changed files with 146 additions and 102 deletions

View File

@ -22,7 +22,7 @@ namespace HermesSocketServer.Requests
if (result)
{
var permissions = channel.GroupPermissions.Get().Values
.Where(p => p.GroupId == groupId);
.Where(p => p.GroupId.ToString() == groupId);
Task? chattersSave = null;
if (channel.Groups.Chatters.TryGetValue(groupId, out var chatters))
@ -32,7 +32,7 @@ namespace HermesSocketServer.Requests
{
foreach (var chatter in filteredChatters)
{
var res = chatters.Remove(chatter.ChatterId.ToString());
var res = chatters.Remove(chatter.ChatterId.ToString(), fromCascade: true);
if (!res)
_logger.Warning($"Failed to delete group chatter by id [group chatter id: {chatter.ChatterId}]");
}
@ -43,7 +43,7 @@ namespace HermesSocketServer.Requests
foreach (var permission in permissions)
{
var res = channel.GroupPermissions.Remove(permission.Id);
var res = channel.GroupPermissions.Remove(permission.Id, fromCascade: true);
if (!res)
_logger.Warning($"Failed to delete group permission by id [group chatter id: {permission.Id}]");
}