Added policy messages for WS. Fixed DB changes via stores. Updated chat voices messages via WS to use stores.

This commit is contained in:
Tom
2024-10-21 20:44:20 +00:00
parent e3c78d96fa
commit 94e0d54c31
19 changed files with 255 additions and 137 deletions

View File

@@ -28,6 +28,7 @@ namespace HermesSocketServer.Requests
if (long.TryParse(data["chatter"].ToString(), out long chatterId))
data["chatter"] = chatterId;
data["voice"] = data["voice"].ToString();
data["user"] = sender;
var check = await _database.ExecuteScalar("SELECT state FROM \"TtsVoiceState\" WHERE \"userId\" = @user AND \"ttsVoiceId\" = @voice", data) ?? false;
if ((check is not bool state || !state) && chatterId != _configuration.Tts.OwnerId)
@@ -37,7 +38,7 @@ namespace HermesSocketServer.Requests
var result = channel.Chatters.Set(chatterId.ToString(), new ChatterVoice()
{
UserId = sender,
ChatterId = chatterId.ToString(),
ChatterId = chatterId,
VoiceId = data["voice"].ToString()!
});
if (result)