Disable comments on story levels if comments are turned off in config.

This commit is contained in:
Slendy 2024-06-25 04:44:03 -05:00
parent 541172b001
commit 98a7f95e65
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -1,6 +1,8 @@
using System.Linq;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Configuration;
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
@ -30,6 +32,13 @@ public class GameDeveloperSlot : SlotBase, INeedsPreparationForSerialization
[XmlElement("photoCount")]
public int PhotoCount { get; set; }
[XmlElement("commentsEnabled")]
public bool CommentsEnabled
{
get => ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled;
set => throw new NotSupportedException();
}
public async Task PrepareSerialization(DatabaseContext database)
{
if (this.SlotId == 0 || this.InternalSlotId == 0) return;