Ensure revision number

This commit is contained in:
M66B 2019-11-22 19:23:37 +01:00
parent 29de070dec
commit 356bfa01fc
1 changed files with 7 additions and 8 deletions

View File

@ -2548,15 +2548,14 @@ public class FragmentCompose extends FragmentBase {
if (data.draft.encrypt == null || !data.draft.encrypt)
EntityOperation.queue(context, data.draft, EntityOperation.ADD);
} else {
if (data.draft.revision == null) {
data.draft.revision = 1;
data.draft.revisions = 1;
db.message().setMessageRevision(data.draft.id, data.draft.revision);
db.message().setMessageRevisions(data.draft.id, data.draft.revisions);
}
if (data.draft.content) {
if (data.draft.revision == null) {
data.draft.revision = 1;
data.draft.revisions = 1;
db.message().setMessageRevision(data.draft.id, data.draft.revision);
db.message().setMessageRevisions(data.draft.id, data.draft.revisions);
}
File file = data.draft.getFile(context);
Document doc = JsoupEx.parse(Helper.readText(file));