mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 08:23:24 +00:00
Ensure outbox
This commit is contained in:
parent
83820ef382
commit
1d8d7e9c1c
3 changed files with 16 additions and 8 deletions
|
@ -221,6 +221,16 @@ public class EntityFolder extends EntityOrder implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
static EntityFolder getOutbox() {
|
||||
EntityFolder outbox = new EntityFolder();
|
||||
outbox.name = "OUTBOX";
|
||||
outbox.type = EntityFolder.OUTBOX;
|
||||
outbox.synchronize = false;
|
||||
outbox.sync_days = 0;
|
||||
outbox.keep_days = 0;
|
||||
return outbox;
|
||||
}
|
||||
|
||||
static String getNotificationChannelId(long id) {
|
||||
return "notification.folder." + id;
|
||||
}
|
||||
|
|
|
@ -3905,8 +3905,11 @@ public class FragmentCompose extends FragmentBase {
|
|||
EntityOperation.queue(context, draft, EntityOperation.DELETE);
|
||||
|
||||
EntityFolder outbox = db.folder().getOutbox();
|
||||
if (outbox == null)
|
||||
throw new IllegalArgumentException("Outbox missing");
|
||||
if (outbox == null) {
|
||||
Log.e("Outbox missing");
|
||||
outbox = EntityFolder.getOutbox();
|
||||
outbox.id = db.folder().insertFolder(outbox);
|
||||
}
|
||||
|
||||
// Copy message to outbox
|
||||
draft.id = null;
|
||||
|
|
|
@ -320,12 +320,7 @@ public class FragmentSetup extends FragmentBase {
|
|||
|
||||
EntityFolder outbox = db.folder().getOutbox();
|
||||
if (outbox == null) {
|
||||
outbox = new EntityFolder();
|
||||
outbox.name = "OUTBOX";
|
||||
outbox.type = EntityFolder.OUTBOX;
|
||||
outbox.synchronize = false;
|
||||
outbox.sync_days = 0;
|
||||
outbox.keep_days = 0;
|
||||
outbox = EntityFolder.getOutbox();
|
||||
outbox.id = db.folder().insertFolder(outbox);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue