fixes for alias display + check aliases on initial uid generation

This commit is contained in:
Stanley Dimant
2022-08-25 01:29:01 +02:00
parent d656513f47
commit 09b305fa67
2 changed files with 2 additions and 2 deletions

View File

@@ -113,7 +113,7 @@ namespace MareSynchronosServer.Hubs
userToOther.UserUID == userid
select new
{
otherEntry.OtherUser.Alias,
userToOther.OtherUser.Alias,
userToOther.IsPaused,
OtherIsPaused = otherEntry != null && otherEntry.IsPaused,
userToOther.OtherUserUID,

View File

@@ -166,7 +166,7 @@ public class DiscordBot : IHostedService
while (!hasValidUid)
{
var uid = GenerateRandomString(10);
if (db.Users.Any(u => u.UID == uid)) continue;
if (db.Users.Any(u => u.UID == uid || u.Alias == uid)) continue;
user.UID = uid;
hasValidUid = true;
}