pleroma: add "to" param to PostStatus
This commit is contained in:
parent
81246c09eb
commit
7a4ead1839
1 changed files with 11 additions and 0 deletions
|
@ -236,6 +236,7 @@ public class Pleroma
|
||||||
/// <param name="quoting"> ID of the status being quoted.</param>
|
/// <param name="quoting"> ID of the status being quoted.</param>
|
||||||
/// <param name="language">ISO 639 language code for this status.</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="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>
|
/// <param name="visibility">Visibility of the posted status.</param>
|
||||||
/// <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>
|
||||||
|
@ -246,6 +247,7 @@ public class Pleroma
|
||||||
string? quoting = null,
|
string? quoting = null,
|
||||||
string? language = null,
|
string? language = null,
|
||||||
MediaID[]? attachments = null,
|
MediaID[]? attachments = null,
|
||||||
|
string[]? to = null,
|
||||||
StatusVisibility visibility = StatusVisibility.Public)
|
StatusVisibility visibility = StatusVisibility.Public)
|
||||||
{
|
{
|
||||||
if (content == null && (attachments == null || attachments.Length == 0))
|
if (content == null && (attachments == null || attachments.Length == 0))
|
||||||
|
@ -305,6 +307,15 @@ public class Pleroma
|
||||||
writer.WriteEndArray();
|
writer.WriteEndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (to != null)
|
||||||
|
{
|
||||||
|
writer.WritePropertyName("to");
|
||||||
|
writer.WriteStartArray();
|
||||||
|
foreach (string name in to)
|
||||||
|
writer.WriteStringValue(name);
|
||||||
|
writer.WriteEndArray();
|
||||||
|
}
|
||||||
|
|
||||||
if (visibility != StatusVisibility.Public)
|
if (visibility != StatusVisibility.Public)
|
||||||
{
|
{
|
||||||
writer.WritePropertyName("visibility");
|
writer.WritePropertyName("visibility");
|
||||||
|
|
Loading…
Reference in a new issue