Add post editing capability (#2828)
* Add post editing capability * Don't try to reprocess already uploaded attachments. Fixes editing posts with existing media * Don't mark post edits as modified until editing occurs * Disable UI for things that can't be edited when editing a post * Finally convert SFragment to kotlin * Use api endpoint for fetching status source for editing * Apply review feedback
This commit is contained in:
parent
51d02388b9
commit
a6b6a40ba6
20 changed files with 676 additions and 527 deletions
|
|
@ -39,6 +39,7 @@ import com.keylesspalace.tusky.entity.ScheduledStatus
|
|||
import com.keylesspalace.tusky.entity.SearchResult
|
||||
import com.keylesspalace.tusky.entity.Status
|
||||
import com.keylesspalace.tusky.entity.StatusContext
|
||||
import com.keylesspalace.tusky.entity.StatusSource
|
||||
import com.keylesspalace.tusky.entity.TimelineAccount
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import okhttp3.MultipartBody
|
||||
|
|
@ -169,11 +170,25 @@ interface MastodonApi {
|
|||
@Path("id") statusId: String
|
||||
): NetworkResult<Status>
|
||||
|
||||
@PUT("api/v1/statuses/{id}")
|
||||
suspend fun editStatus(
|
||||
@Path("id") statusId: String,
|
||||
@Header("Authorization") auth: String,
|
||||
@Header(DOMAIN_HEADER) domain: String,
|
||||
@Header("Idempotency-Key") idempotencyKey: String,
|
||||
@Body editedStatus: NewStatus,
|
||||
): NetworkResult<Status>
|
||||
|
||||
@GET("api/v1/statuses/{id}")
|
||||
suspend fun statusAsync(
|
||||
@Path("id") statusId: String
|
||||
): NetworkResult<Status>
|
||||
|
||||
@GET("api/v1/statuses/{id}/source")
|
||||
suspend fun statusSource(
|
||||
@Path("id") statusId: String
|
||||
): NetworkResult<StatusSource>
|
||||
|
||||
@GET("api/v1/statuses/{id}/context")
|
||||
suspend fun statusContext(
|
||||
@Path("id") statusId: String
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue