Added policy messages for WS. Fixed DB changes via stores. Updated chat voices messages via WS to use stores.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user