Loading app/src/main/java/app/fedilab/android/client/endpoints/MastodonStatusesService.java +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import app.fedilab.android.client.entities.api.Poll; import app.fedilab.android.client.entities.api.ScheduledStatus; import app.fedilab.android.client.entities.api.Status; import okhttp3.MultipartBody; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.http.DELETE; import retrofit2.http.Field; Loading Loading @@ -217,7 +218,7 @@ public interface MastodonStatusesService { @Header("Authorization") String token, @Part MultipartBody.Part file, @Part MultipartBody.Part thumbnail, @Part("description") String description, @Part("description") RequestBody description, @Part("focus") String focus ); Loading app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java +4 −1 Original line number Diff line number Diff line Loading @@ -62,8 +62,10 @@ import app.fedilab.android.client.entities.app.StatusDraft; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; import app.fedilab.android.ui.drawer.StatusAdapter; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.Response; import retrofit2.Retrofit; Loading Loading @@ -325,7 +327,8 @@ public class ComposeWorker extends Worker { private static String postAttachment(MastodonStatusesService mastodonStatusesService, DataPost dataPost, MultipartBody.Part fileMultipartBody, Attachment attachment) { Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(dataPost.token, fileMultipartBody, null, attachment.description, attachment.focus); RequestBody descriptionBody = RequestBody.create(MediaType.parse("text/plain"), attachment.description); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(dataPost.token, fileMultipartBody, null, descriptionBody, attachment.focus); if (attachmentCall != null) { try { Loading app/src/main/java/app/fedilab/android/viewmodel/mastodon/StatusesVM.java +4 −1 Original line number Diff line number Diff line Loading @@ -49,8 +49,10 @@ import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.TimelineHelper; import okhttp3.Headers; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.Response; import retrofit2.Retrofit; Loading Loading @@ -118,7 +120,8 @@ public class StatusesVM extends AndroidViewModel { MultipartBody.Part thumbnailMultipartBody; fileMultipartBody = Helper.getMultipartBody(getApplication(), "file", file); thumbnailMultipartBody = Helper.getMultipartBody(getApplication(), "file", thumbnail); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(token, fileMultipartBody, thumbnailMultipartBody, description, focus); RequestBody descriptionBody = RequestBody.create(MediaType.parse("text/plain"), description); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(token, fileMultipartBody, thumbnailMultipartBody, descriptionBody, focus); Attachment attachment = null; if (attachmentCall != null) { try { Loading Loading
app/src/main/java/app/fedilab/android/client/endpoints/MastodonStatusesService.java +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import app.fedilab.android.client.entities.api.Poll; import app.fedilab.android.client.entities.api.ScheduledStatus; import app.fedilab.android.client.entities.api.Status; import okhttp3.MultipartBody; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.http.DELETE; import retrofit2.http.Field; Loading Loading @@ -217,7 +218,7 @@ public interface MastodonStatusesService { @Header("Authorization") String token, @Part MultipartBody.Part file, @Part MultipartBody.Part thumbnail, @Part("description") String description, @Part("description") RequestBody description, @Part("focus") String focus ); Loading
app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java +4 −1 Original line number Diff line number Diff line Loading @@ -62,8 +62,10 @@ import app.fedilab.android.client.entities.app.StatusDraft; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; import app.fedilab.android.ui.drawer.StatusAdapter; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.Response; import retrofit2.Retrofit; Loading Loading @@ -325,7 +327,8 @@ public class ComposeWorker extends Worker { private static String postAttachment(MastodonStatusesService mastodonStatusesService, DataPost dataPost, MultipartBody.Part fileMultipartBody, Attachment attachment) { Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(dataPost.token, fileMultipartBody, null, attachment.description, attachment.focus); RequestBody descriptionBody = RequestBody.create(MediaType.parse("text/plain"), attachment.description); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(dataPost.token, fileMultipartBody, null, descriptionBody, attachment.focus); if (attachmentCall != null) { try { Loading
app/src/main/java/app/fedilab/android/viewmodel/mastodon/StatusesVM.java +4 −1 Original line number Diff line number Diff line Loading @@ -49,8 +49,10 @@ import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.TimelineHelper; import okhttp3.Headers; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.Response; import retrofit2.Retrofit; Loading Loading @@ -118,7 +120,8 @@ public class StatusesVM extends AndroidViewModel { MultipartBody.Part thumbnailMultipartBody; fileMultipartBody = Helper.getMultipartBody(getApplication(), "file", file); thumbnailMultipartBody = Helper.getMultipartBody(getApplication(), "file", thumbnail); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(token, fileMultipartBody, thumbnailMultipartBody, description, focus); RequestBody descriptionBody = RequestBody.create(MediaType.parse("text/plain"), description); Call<Attachment> attachmentCall = mastodonStatusesService.postMedia(token, fileMultipartBody, thumbnailMultipartBody, descriptionBody, focus); Attachment attachment = null; if (attachmentCall != null) { try { Loading