diff --git a/Moonlight/Core/Http/Controllers/AvatarController.cs b/Moonlight/Core/Http/Controllers/AvatarController.cs index 617363d2..1b235ff5 100644 --- a/Moonlight/Core/Http/Controllers/AvatarController.cs +++ b/Moonlight/Core/Http/Controllers/AvatarController.cs @@ -55,9 +55,9 @@ public class AvatarController : Controller if (!IdentityService.IsLoggedIn) return StatusCode(403); - if (ConfigService.Get().Security.EnforceAvatarPrivacy && - id != IdentityService.CurrentUser.Id && - IdentityService.CurrentUser.Permissions < 1000) + if (ConfigService.Get().Security.EnforceAvatarPrivacy && // Do we need to enforce privacy? + id != IdentityService.CurrentUser.Id && // is the user not viewing his own image? + IdentityService.CurrentUser.Permissions < 1000) // and not an admin? { return StatusCode(403); } diff --git a/Moonlight/Core/Services/DiagnoseService.cs b/Moonlight/Core/Services/DiagnoseService.cs index a38bbe30..b76bbc2f 100644 --- a/Moonlight/Core/Services/DiagnoseService.cs +++ b/Moonlight/Core/Services/DiagnoseService.cs @@ -22,13 +22,16 @@ public class DiagnoseService { using var scope = ServiceProvider.CreateScope(); + // Create in memory zip archive using var dataStream = new MemoryStream(); var zipArchive = new ZipArchive(dataStream, ZipArchiveMode.Create, true); + // Call every plugin to perform their modifications to the file await PluginService.ExecuteFuncAsync( async x => await x.GenerateReport(zipArchive, scope.ServiceProvider) ); + // Add a timestamp await zipArchive.AddText("exported_at.txt", Formatter.FormatDate(DateTime.UtcNow)); zipArchive.Dispose(); diff --git a/Moonlight/Core/Services/UnloadService.cs b/Moonlight/Core/Services/UnloadService.cs index 6da58639..d62ced48 100644 --- a/Moonlight/Core/Services/UnloadService.cs +++ b/Moonlight/Core/Services/UnloadService.cs @@ -5,7 +5,7 @@ using MoonCore.Helpers; namespace Moonlight.Core.Services; /// -/// This class provides a event to execute code when a user leaves the page +/// This class provides an event to execute code when a user leaves the page /// [Scoped]