[backend/api] Add IsBot, IsCat and SpeakAsCat profile settings
This commit is contained in:
parent
6656fbac18
commit
dad0fabc5b
2 changed files with 12 additions and 1 deletions
|
@ -34,7 +34,10 @@ public class ProfileController(UserService userSvc, DriveService driveSvc) : Con
|
||||||
Location = profile.Location,
|
Location = profile.Location,
|
||||||
Birthday = profile.Birthday,
|
Birthday = profile.Birthday,
|
||||||
FFVisibility = ffVisibility,
|
FFVisibility = ffVisibility,
|
||||||
Fields = fields.ToList()
|
Fields = fields.ToList(),
|
||||||
|
IsBot = user.IsBot,
|
||||||
|
IsCat = user.IsCat,
|
||||||
|
SpeakAsCat = user.SpeakAsCat
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +70,10 @@ public class ProfileController(UserService userSvc, DriveService driveSvc) : Con
|
||||||
profile.Fields = fields.ToArray();
|
profile.Fields = fields.ToArray();
|
||||||
profile.FFVisibility = (UserProfile.UserProfileFFVisibility)newProfile.FFVisibility;
|
profile.FFVisibility = (UserProfile.UserProfileFFVisibility)newProfile.FFVisibility;
|
||||||
|
|
||||||
|
user.IsBot = newProfile.IsBot;
|
||||||
|
user.IsCat = newProfile.IsCat;
|
||||||
|
user.SpeakAsCat = newProfile is { SpeakAsCat: true, IsCat: true };
|
||||||
|
|
||||||
var prevAvatarId = user.AvatarId;
|
var prevAvatarId = user.AvatarId;
|
||||||
var prevBannerId = user.BannerId;
|
var prevBannerId = user.BannerId;
|
||||||
await userSvc.UpdateLocalUserAsync(user, prevAvatarId, prevBannerId);
|
await userSvc.UpdateLocalUserAsync(user, prevAvatarId, prevBannerId);
|
||||||
|
|
|
@ -17,6 +17,10 @@ public class UserProfileEntity
|
||||||
|
|
||||||
public required List<Field> Fields { get; set; }
|
public required List<Field> Fields { get; set; }
|
||||||
public required FFVisibilityEnum FFVisibility { get; set; }
|
public required FFVisibilityEnum FFVisibility { get; set; }
|
||||||
|
|
||||||
|
public required bool IsBot { get; set; }
|
||||||
|
public required bool IsCat { get; set; }
|
||||||
|
public required bool SpeakAsCat { get; set; }
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
public enum FFVisibilityEnum
|
public enum FFVisibilityEnum
|
||||||
|
|
Loading…
Add table
Reference in a new issue