add more options to default reply visibility setting (#4568)
This adds `direct` and `match_default_post_visibility` as options to the default reply visibility setting. `match_default_post_visibility` will be the default for new accounts. closes https://github.com/tuskyapp/Tusky/issues/4555 <img src="https://github.com/user-attachments/assets/b256ff32-cd49-4274-903b-96da96451e0e" width="320"/>
This commit is contained in:
parent
18b943fef5
commit
892801b83a
13 changed files with 135 additions and 35 deletions
|
|
@ -68,7 +68,7 @@ data class Status(
|
|||
get() = reblog ?: this
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class Visibility(val num: Int) {
|
||||
enum class Visibility(val int: Int) {
|
||||
UNKNOWN(0),
|
||||
|
||||
@Json(name = "public")
|
||||
|
|
@ -83,7 +83,7 @@ data class Status(
|
|||
@Json(name = "direct")
|
||||
DIRECT(4);
|
||||
|
||||
val serverString: String
|
||||
val stringValue: String
|
||||
get() = when (this) {
|
||||
PUBLIC -> "public"
|
||||
UNLISTED -> "unlisted"
|
||||
|
|
@ -93,10 +93,8 @@ data class Status(
|
|||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun byNum(num: Int): Visibility {
|
||||
return when (num) {
|
||||
fun fromInt(int: Int): Visibility {
|
||||
return when (int) {
|
||||
4 -> DIRECT
|
||||
3 -> PRIVATE
|
||||
2 -> UNLISTED
|
||||
|
|
@ -106,8 +104,7 @@ data class Status(
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun byString(s: String): Visibility {
|
||||
fun fromStringValue(s: String): Visibility {
|
||||
return when (s) {
|
||||
"public" -> PUBLIC
|
||||
"unlisted" -> UNLISTED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue