mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-19 11:41:30 +00:00
Miscellaneous website/moderation/notification fixes (#940)
This commit is contained in:
parent
0de5edca6e
commit
69855406f5
4 changed files with 11 additions and 11 deletions
|
@ -89,16 +89,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.";
|
||||||
|
|
||||||
StringBuilder builder = new();
|
StringBuilder builder = new();
|
||||||
|
|
||||||
// ReSharper disable once ForCanBeConvertedToForeach
|
foreach (NotificationEntity notification in notifications)
|
||||||
// Suppressing this because we need to modify the list while iterating over it.
|
|
||||||
for (int i = 0; i < notifications.Count; i++)
|
|
||||||
{
|
{
|
||||||
NotificationEntity n = notifications[i];
|
|
||||||
|
|
||||||
builder.AppendLine(LighthouseSerializer.Serialize(this.HttpContext.RequestServices,
|
builder.AppendLine(LighthouseSerializer.Serialize(this.HttpContext.RequestServices,
|
||||||
GameNotification.CreateFromEntity(n)));
|
GameNotification.CreateFromEntity(notification)));
|
||||||
|
|
||||||
n.IsDismissed = true;
|
notification.IsDismissed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.database.SaveChangesAsync();
|
await this.database.SaveChangesAsync();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class SlotPage : BaseLayout
|
||||||
// Determine if user can view slot according to creator's privacy settings
|
// Determine if user can view slot according to creator's privacy settings
|
||||||
this.CanViewSlot = slot.Creator.LevelVisibility.CanAccess(isAuthenticated, isOwner);
|
this.CanViewSlot = slot.Creator.LevelVisibility.CanAccess(isAuthenticated, isOwner);
|
||||||
|
|
||||||
if ((slot.Hidden || slot.SubLevel && (this.User == null && this.User != slot.Creator)) && !(this.User?.IsModerator ?? false))
|
if ((slot.Hidden || slot.SubLevel && (this.User == null || this.User != slot.Creator)) && !(this.User?.IsModerator ?? false))
|
||||||
return this.NotFound();
|
return this.NotFound();
|
||||||
|
|
||||||
string slotSlug = slot.GenerateSlug();
|
string slotSlug = slot.GenerateSlug();
|
||||||
|
|
|
@ -68,6 +68,7 @@ public class UserPage : BaseLayout
|
||||||
this.Slots = await this.Database.Slots.Include(p => p.Creator)
|
this.Slots = await this.Database.Slots.Include(p => p.Creator)
|
||||||
.OrderByDescending(s => s.LastUpdated)
|
.OrderByDescending(s => s.LastUpdated)
|
||||||
.Where(p => p.CreatorId == userId)
|
.Where(p => p.CreatorId == userId)
|
||||||
|
.Where(p => p.Creator != null && (!p.SubLevel || p.Creator == this.User))
|
||||||
.Take(10)
|
.Take(10)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,9 @@ public class DismissExpiredCasesTask : IRepeatingTask
|
||||||
{
|
{
|
||||||
@case.DismissedAt = DateTime.UtcNow;
|
@case.DismissedAt = DateTime.UtcNow;
|
||||||
@case.DismisserUsername = "maintenance task";
|
@case.DismisserUsername = "maintenance task";
|
||||||
|
|
||||||
|
@case.Processed = false;
|
||||||
|
|
||||||
Logger.Info($"Dismissed expired case {@case.CaseId}", LogArea.Maintenance);
|
Logger.Info($"Dismissed expired case {@case.CaseId}", LogArea.Maintenance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue