Added more fields to LoginAck to reduce web API needs on client.
This commit is contained in:
@ -74,10 +74,20 @@ namespace HermesSocketServer.Socket.Handlers
|
|||||||
if (string.IsNullOrEmpty(channel.User.DefaultVoice))
|
if (string.IsNullOrEmpty(channel.User.DefaultVoice))
|
||||||
_logger.Warning($"No default voice was set for an user [user id: {userId}][api key: {data.ApiKey}]");
|
_logger.Warning($"No default voice was set for an user [user id: {userId}][api key: {data.ApiKey}]");
|
||||||
|
|
||||||
|
sql = "select \"providerAccountId\" from \"Account\" where \"userId\" = @user and provider = @provider";
|
||||||
|
var result2 = await _database.ExecuteScalar(sql, new Dictionary<string, object>() { { "user", userId }, { "provider", "twitch" } });
|
||||||
|
var providerId = result2?.ToString();
|
||||||
|
if (providerId == null) {
|
||||||
|
_logger.Warning($"Could not find the Provider Account Id [user id: {userId}][provider: twitch]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var ack = new LoginAckMessage()
|
var ack = new LoginAckMessage()
|
||||||
{
|
{
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
|
ProviderAccountId = providerId,
|
||||||
SessionId = sender.UID,
|
SessionId = sender.UID,
|
||||||
|
UserName = channel.User.Name,
|
||||||
OwnerId = _configuration.Tts.OwnerId,
|
OwnerId = _configuration.Tts.OwnerId,
|
||||||
Admin = sender.Admin,
|
Admin = sender.Admin,
|
||||||
WebLogin = data.WebLogin,
|
WebLogin = data.WebLogin,
|
||||||
|
Reference in New Issue
Block a user