Add support for updating media description and focus point when editing statuses (#3215)
* Add support for updating media description and focus point when editing statuses * Don't publish description/focus point updates via the standard api when editing a published post
This commit is contained in:
parent
d34586b7c8
commit
395e21c956
5 changed files with 43 additions and 17 deletions
|
|
@ -83,7 +83,9 @@ data class Attachment(
|
|||
data class Focus(
|
||||
val x: Float,
|
||||
val y: Float
|
||||
) : Parcelable
|
||||
) : Parcelable {
|
||||
fun toMastodonApiString(): String = "$x,$y"
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of an image, used to specify the width/height.
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ data class NewStatus(
|
|||
val visibility: String,
|
||||
val sensitive: Boolean,
|
||||
@SerializedName("media_ids") val mediaIds: List<String>?,
|
||||
@SerializedName("media_attributes") val mediaAttributes: List<MediaAttribute>?,
|
||||
@SerializedName("scheduled_at") val scheduledAt: String?,
|
||||
val poll: NewPoll?,
|
||||
val language: String?,
|
||||
|
|
@ -37,3 +38,13 @@ data class NewPoll(
|
|||
@SerializedName("expires_in") val expiresIn: Int,
|
||||
val multiple: Boolean
|
||||
) : Parcelable
|
||||
|
||||
// It would be nice if we could reuse MediaToSend,
|
||||
// but the server requires a different format for focus
|
||||
@Parcelize
|
||||
data class MediaAttribute(
|
||||
val id: String,
|
||||
val description: String?,
|
||||
val focus: String?,
|
||||
val thumbnail: String?,
|
||||
) : Parcelable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue