[backend/akko-client] Stub out preview flag to not accidentally spam people

This commit is contained in:
Kopper 2024-09-01 01:06:21 +03:00 committed by Iceshrimp development
parent 26ec42bc62
commit 410519dafa
2 changed files with 7 additions and 0 deletions

View file

@ -45,6 +45,10 @@ public abstract class StatusSchemas
[B(Name = "poll")] [J("poll")] public PollData? Poll { get; set; }
[B(Name = "preview")]
[J("preview")]
public bool Preview { get; set; } = false;
public class PollData
{
[B(Name = "options")]

View file

@ -330,6 +330,9 @@ public class StatusController(
[ProducesErrors(HttpStatusCode.BadRequest, HttpStatusCode.UnprocessableEntity)]
public async Task<StatusEntity> PostNote([FromHybrid] StatusSchemas.PostStatusRequest request)
{
if (request.Preview)
throw GracefulException.UnprocessableEntity("Previewing is not supported yet");
var token = HttpContext.GetOauthToken() ?? throw new Exception("Token must not be null at this stage");
var user = token.User;