Avoid overwriting title for new notes

This commit is contained in:
Johannes 2020-12-27 22:56:54 +01:00 committed by Niedermann IT-Dienstleistungen
parent 9f9d7e2660
commit 3be495ef8a

View file

@ -546,7 +546,8 @@ public class NotesDatabase extends AbstractNotesDatabase {
if (newTitle != null) {
title = newTitle;
} else {
if (oldNote.getRemoteId() == 0 || localAccount.getPreferredApiVersion() == null || localAccount.getPreferredApiVersion().compareTo(new ApiVersion("1.0", 0, 0)) < 0) {
if ((oldNote.getRemoteId() == 0 || localAccount.getPreferredApiVersion() == null || localAccount.getPreferredApiVersion().compareTo(new ApiVersion("1.0", 0, 0)) < 0) &&
(oldNote.getTitle().equals(NoteUtil.generateNonEmptyNoteTitle("", getContext())))) {
title = NoteUtil.generateNonEmptyNoteTitle(newContent, getContext());
} else {
title = oldNote.getTitle();