feat(announce): Automatically mark Mastodon follow ups as unlisted. Resolves
*/
package org.jreleaser.sdk.mastodon.api;
+import static org.jreleaser.util.StringUtils.isNotBlank;
import static org.jreleaser.util.StringUtils.requireNonBlank;
/**
@@ -27,6 +28,7 @@ public class Status {
private String id;
private String status;
private String in_reply_to_id;
+ private String visibility;
public String getStatus() {
return status;
@@ -41,6 +43,7 @@ public class Status {
return "Status[" +
"id='" + id + "'," +
"in_reply_to_id='" + in_reply_to_id + "'," +
+ "visibility='" + visibility + "'," +
"status='" + status + '\'' +
']';
}
@@ -53,6 +56,7 @@ public class Status {
Status o = new Status();
o.status = requireNonBlank(status, "'status' must not be blank").trim();
o.in_reply_to_id = inReplyToId;
+ if (isNotBlank(inReplyToId)) o.visibility = "unlisted";
return o;
}
@@ -71,4 +75,12 @@ public class Status {
public void setIn_reply_to_id(String in_reply_to_id) {
this.in_reply_to_id = in_reply_to_id;
}
+
+ public String getVisibility() {
+ return visibility;
+ }
+
+ public void setVisibility(String visibility) {
+ this.visibility = visibility;
+ }
}
