diff --git a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Groups.cs b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Groups.cs index e15eee5..a5b10b5 100644 --- a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Groups.cs +++ b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Groups.cs @@ -749,16 +749,11 @@ public partial class LightlessHub .FirstOrDefaultAsync(g => g.Group.GID == dto.Group.GID || g.Group.Alias == dto.Group.GID, cancellationToken) .ConfigureAwait(false); - var profileDto = new GroupProfileDto(dto.Group, Description: null, Tags: null, PictureBase64: null); + var profileDto = new GroupProfileDto(dto.Group, Description: null, Tags: null, PictureBase64: null, IsNsfw: false, IsDisabled: false); if (data is not null) { - profileDto = profileDto with - { - Description = data.Description, - Tags = data.Tags, - PictureBase64 = data.Base64GroupProfileImage, - }; + profileDto = data.ToDTO(); } return profileDto; @@ -791,7 +786,8 @@ public partial class LightlessHub { groupProfileDb.Base64GroupProfileImage = dto.PictureBase64; } - else if (dto.Tags != null) + + if (dto.Tags != null) { groupProfileDb.Tags = dto.Tags; } @@ -801,6 +797,11 @@ public partial class LightlessHub groupProfileDb.Description = dto.Description; } + if (dto.IsNsfw != null) + { + groupProfileDb.IsNSFW = dto.IsNsfw.Value; + } + await Clients.Users(groupPairs).Client_GroupSendProfile(groupProfileDb.ToDTO()).ConfigureAwait(false); } else diff --git a/LightlessSyncServer/LightlessSyncServer/Utils/Extensions.cs b/LightlessSyncServer/LightlessSyncServer/Utils/Extensions.cs index 33e367f..0c1ae44 100644 --- a/LightlessSyncServer/LightlessSyncServer/Utils/Extensions.cs +++ b/LightlessSyncServer/LightlessSyncServer/Utils/Extensions.cs @@ -11,7 +11,7 @@ public static class Extensions { public static GroupProfileDto ToDTO(this GroupProfile groupProfile) { - return new GroupProfileDto(groupProfile.Group.ToGroupData(), groupProfile.Description, groupProfile.Tags, groupProfile.Base64GroupProfileImage); + return new GroupProfileDto(groupProfile.Group.ToGroupData(), groupProfile.Description, groupProfile.Tags, groupProfile.Base64GroupProfileImage, groupProfile.IsNSFW, groupProfile.ProfileDisabled); } public static GroupData ToGroupData(this Group group)