[backend] Fix build

This commit is contained in:
Laura Hausmann 2024-09-16 01:10:27 +02:00
parent f1e5200c6a
commit f3488fdca3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 6 additions and 2 deletions

View file

@ -26,7 +26,7 @@ public class NoteModel(
public string? QuoteUrl; public string? QuoteUrl;
public bool ShowMedia = security.Value.PublicPreview > Enums.PublicPreview.RestrictedNoMedia; public bool ShowMedia = security.Value.PublicPreview > Enums.PublicPreview.RestrictedNoMedia;
public bool ShowRemoteReplies = security.Value.PublicPreview > Enums.PublicPreview.Restricted; public bool ShowRemoteReplies = security.Value.PublicPreview > Enums.PublicPreview.Restricted;
public string InstanceName = await meta.Get(MetaEntity.InstanceName) ?? "Iceshrimp.NET"; public string InstanceName = "Iceshrimp.NET";
public Dictionary<string, string> TextContent = new(); public Dictionary<string, string> TextContent = new();
@ -42,6 +42,8 @@ public class NoteModel(
throw GracefulException.Forbidden("Public preview is disabled on this instance.", throw GracefulException.Forbidden("Public preview is disabled on this instance.",
"The instance administrator has intentionally disabled this feature for privacy reasons."); "The instance administrator has intentionally disabled this feature for privacy reasons.");
InstanceName = await meta.Get(MetaEntity.InstanceName) ?? InstanceName;
//TODO: redirect to login (with route as url param) when public preview is disabled //TODO: redirect to login (with route as url param) when public preview is disabled
//TODO: login button //TODO: login button
//TODO: thread view (respect public preview settings - don't show remote replies if set to restricted or lower) //TODO: thread view (respect public preview settings - don't show remote replies if set to restricted or lower)

View file

@ -24,7 +24,7 @@ public class UserModel(
public new User? User; public new User? User;
public string? Bio; public string? Bio;
public bool ShowMedia = security.Value.PublicPreview > Enums.PublicPreview.RestrictedNoMedia; public bool ShowMedia = security.Value.PublicPreview > Enums.PublicPreview.RestrictedNoMedia;
public string InstanceName = await meta.Get(MetaEntity.InstanceName) ?? "Iceshrimp.NET"; public string InstanceName = "Iceshrimp.NET";
[SuppressMessage("ReSharper", "EntityFramework.NPlusOne.IncompleteDataQuery", [SuppressMessage("ReSharper", "EntityFramework.NPlusOne.IncompleteDataQuery",
Justification = "IncludeCommonProperties")] Justification = "IncludeCommonProperties")]
@ -38,6 +38,8 @@ public class UserModel(
throw GracefulException.Forbidden("Public preview is disabled on this instance.", throw GracefulException.Forbidden("Public preview is disabled on this instance.",
"The instance administrator has intentionally disabled this feature for privacy reasons."); "The instance administrator has intentionally disabled this feature for privacy reasons.");
InstanceName = await meta.Get(MetaEntity.InstanceName) ?? InstanceName;
//TODO: login button //TODO: login button
//TODO: user note view (respect public preview settings - don't show renotes of remote notes if set to restricted or lower) //TODO: user note view (respect public preview settings - don't show renotes of remote notes if set to restricted or lower)
//TODO: emoji //TODO: emoji