pleroma: add "to" param to PostStatus

This commit is contained in:
uwaa 2025-01-06 23:57:48 +00:00
parent 81246c09eb
commit 7a4ead1839

View file

@ -236,6 +236,7 @@ public class Pleroma
/// <param name="quoting"> ID of the status being quoted.</param>
/// <param name="language">ISO 639 language code for this status.</param>
/// <param name="attachments">Array of Attachment ids to be attached as media.</param>
/// <param name="to">A list of nicknames (like <c>lain@soykaf.club</c> or <c>lain</c> on the local server) that will be used to determine who is going to be addressed by this post. Using this will disable the implicit addressing by mentioned names in the <paramref name="content"/>, only the people in the <paramref name="to"/> list will be addressed. The normal rules for post visibility are not affected by this and will still apply</param>
/// <param name="visibility">Visibility of the posted status.</param>
/// <exception cref="HttpRequestException">Thrown if something goes wrong while publishing the status.</exception>
/// <returns>The newly published status if posting was successful.</returns>
@ -246,6 +247,7 @@ public class Pleroma
string? quoting = null,
string? language = null,
MediaID[]? attachments = null,
string[]? to = null,
StatusVisibility visibility = StatusVisibility.Public)
{
if (content == null && (attachments == null || attachments.Length == 0))
@ -305,6 +307,15 @@ public class Pleroma
writer.WriteEndArray();
}
if (to != null)
{
writer.WritePropertyName("to");
writer.WriteStartArray();
foreach (string name in to)
writer.WriteStringValue(name);
writer.WriteEndArray();
}
if (visibility != StatusVisibility.Public)
{
writer.WritePropertyName("visibility");