Fix issue when sending messages with images

This commit is contained in:
Thomas 2022-10-05 11:46:10 +02:00
parent a7675fbe03
commit dc8243fd19
3 changed files with 5 additions and 2 deletions

View File

@ -848,6 +848,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
.build();
WorkManager.getInstance(ComposeActivity.this).enqueue(request);
} else {
new ThreadMessageService(ComposeActivity.this, instance, account.user_id, token, statusDraft, scheduledDate);
}

View File

@ -346,7 +346,10 @@ public class StatusDraft implements Serializable {
}
try {
Cursor c = db.query(Sqlite.TABLE_STATUS_DRAFT, null, Sqlite.COL_ID + " = '" + draftId + "'", null, null, null, null, "1");
return convertCursorToStatusDraft(c);
c.moveToFirst();
StatusDraft statusDraft = convertCursorToStatusDraft(c);
c.close();
return statusDraft;
} catch (Exception e) {
return null;
}

View File

@ -400,7 +400,6 @@ public class ComposeWorker extends Worker {
@NonNull
private ForegroundInfo createForegroundInfo() {
// Build a notification using bytesRead and contentLength
Context context = getApplicationContext();
// This PendingIntent can be used to cancel the worker
PendingIntent intent = WorkManager.getInstance(context)