1
0
mirror of https://codeberg.org/tom79/Fedilab synced 2024-12-12 03:16:36 +01:00

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) .setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
.build(); .build();
WorkManager.getInstance(ComposeActivity.this).enqueue(request); WorkManager.getInstance(ComposeActivity.this).enqueue(request);
} else { } else {
new ThreadMessageService(ComposeActivity.this, instance, account.user_id, token, statusDraft, scheduledDate); new ThreadMessageService(ComposeActivity.this, instance, account.user_id, token, statusDraft, scheduledDate);
} }

View File

@ -346,7 +346,10 @@ public class StatusDraft implements Serializable {
} }
try { try {
Cursor c = db.query(Sqlite.TABLE_STATUS_DRAFT, null, Sqlite.COL_ID + " = '" + draftId + "'", null, null, null, null, "1"); 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) { } catch (Exception e) {
return null; return null;
} }

View File

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