mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 16:33:47 +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) {
|
static String getNotificationChannelId(long id) {
|
||||||
return "notification.folder." + id;
|
return "notification.folder." + id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3905,8 +3905,11 @@ public class FragmentCompose extends FragmentBase {
|
||||||
EntityOperation.queue(context, draft, EntityOperation.DELETE);
|
EntityOperation.queue(context, draft, EntityOperation.DELETE);
|
||||||
|
|
||||||
EntityFolder outbox = db.folder().getOutbox();
|
EntityFolder outbox = db.folder().getOutbox();
|
||||||
if (outbox == null)
|
if (outbox == null) {
|
||||||
throw new IllegalArgumentException("Outbox missing");
|
Log.e("Outbox missing");
|
||||||
|
outbox = EntityFolder.getOutbox();
|
||||||
|
outbox.id = db.folder().insertFolder(outbox);
|
||||||
|
}
|
||||||
|
|
||||||
// Copy message to outbox
|
// Copy message to outbox
|
||||||
draft.id = null;
|
draft.id = null;
|
||||||
|
|
|
@ -320,12 +320,7 @@ public class FragmentSetup extends FragmentBase {
|
||||||
|
|
||||||
EntityFolder outbox = db.folder().getOutbox();
|
EntityFolder outbox = db.folder().getOutbox();
|
||||||
if (outbox == null) {
|
if (outbox == null) {
|
||||||
outbox = new EntityFolder();
|
outbox = EntityFolder.getOutbox();
|
||||||
outbox.name = "OUTBOX";
|
|
||||||
outbox.type = EntityFolder.OUTBOX;
|
|
||||||
outbox.synchronize = false;
|
|
||||||
outbox.sync_days = 0;
|
|
||||||
outbox.keep_days = 0;
|
|
||||||
outbox.id = db.folder().insertFolder(outbox);
|
outbox.id = db.folder().insertFolder(outbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue