fix scheduling posts (#4392)

Mastodon returns different reponses when posting normally and when
scheduling. This was previously ignored silently, but Moshi is more
correct than Gson and fails, which causes the `SendStatusService` to
retry sending forever and a lot of posts are scheduled.
Mastodon should actually ignore multiple attempts at scheduling the same
post, but doesn't so I filed this
https://github.com/mastodon/mastodon/issues/30039

cc @cbeyls
This commit is contained in:
Konrad Pozniak 2024-04-25 17:08:57 +02:00 committed by GitHub
commit c55d79562c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 12 deletions

View file

@ -199,6 +199,14 @@ interface MastodonApi {
@Body status: NewStatus
): NetworkResult<Status>
@POST("api/v1/statuses")
suspend fun createScheduledStatus(
@Header("Authorization") auth: String,
@Header(DOMAIN_HEADER) domain: String,
@Header("Idempotency-Key") idempotencyKey: String,
@Body status: NewStatus
): NetworkResult<ScheduledStatus>
@GET("api/v1/statuses/{id}")
suspend fun status(@Path("id") statusId: String): NetworkResult<Status>