diff --git a/app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java b/app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java index 6637c03cc..f66b8ca3b 100644 --- a/app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java +++ b/app/src/main/java/app/fedilab/android/jobs/ComposeWorker.java @@ -270,7 +270,11 @@ public class ComposeWorker extends Worker { b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true); Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE); b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft); - b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, statusResponse.errorBody().string()); + String err = statusResponse.errorBody().string(); + if (err.contains("{\"error\":\"")) { + err = err.replaceAll("\\{\"error\":\"(.*)\"}", "$1"); + } + b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, err); intentBD.putExtras(b); LocalBroadcastManager.getInstance(context).sendBroadcast(intentBD); return;