pleroma: content type

This commit is contained in:
uwaa 2025-01-08 13:42:14 +00:00
parent 4c0b3a9327
commit dba49f359a

View file

@ -230,6 +230,7 @@ public class Pleroma
/// Posts a status. /// Posts a status.
/// </summary> /// </summary>
/// <param name="content">Text content of the status.</param> /// <param name="content">Text content of the status.</param>
/// <param name="content_type">The MIME type of the <paramref name="content"/>.</param>
/// <param name="sensitive">Mark status and attached media as sensitive?</param> /// <param name="sensitive">Mark status and attached media as sensitive?</param>
/// <param name="expiresIn">The number of seconds the posted activity should expire in. When a posted activity expires it will be deleted from the server, and a delete request for it will be federated. This needs to be longer than an hour.</param> /// <param name="expiresIn">The number of seconds the posted activity should expire in. When a posted activity expires it will be deleted from the server, and a delete request for it will be federated. This needs to be longer than an hour.</param>
/// <param name="replyTo">ID of the status being replied to, if status is a reply</param> /// <param name="replyTo">ID of the status being replied to, if status is a reply</param>
@ -241,6 +242,7 @@ public class Pleroma
/// <exception cref="HttpRequestException">Thrown if something goes wrong while publishing the status.</exception> /// <exception cref="HttpRequestException">Thrown if something goes wrong while publishing the status.</exception>
/// <returns>The newly published status if posting was successful.</returns> /// <returns>The newly published status if posting was successful.</returns>
public Task<Status> PostStatus(string? content = null, public Task<Status> PostStatus(string? content = null,
string content_type = "text/plain",
bool sensitive = false, bool sensitive = false,
int? expiresIn = null, int? expiresIn = null,
StatusID? replyTo = null, StatusID? replyTo = null,
@ -264,8 +266,8 @@ public class Pleroma
writer.WritePropertyName("status"); writer.WritePropertyName("status");
writer.WriteStringValue(content); writer.WriteStringValue(content);
writer.WritePropertyName("content-type"); writer.WritePropertyName("content_type");
writer.WriteStringValue("text/plain"); writer.WriteStringValue(content_type);
} }
if (sensitive) if (sensitive)