Fix issue #343
This commit is contained in:
parent
40be73bd9b
commit
79a1b41d50
|
@ -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;
|
||||
|
@ -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
|
||||
);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
@ -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…
Reference in New Issue