Check for duplicate adds

pull/156/head
M66B 6 years ago
parent 6695a0c26b
commit 4413d5f01a

@ -1352,6 +1352,13 @@ class Core {
try {
db.beginTransaction();
// Check if message was added in the meantime
EntityMessage existing = db.message().getMessageByUid(message.folder, message.uid);
if (existing != null) {
Log.i("Message was already added");
return existing;
}
message.id = db.message().insertMessage(message);
Log.i(folder.name + " added id=" + message.id + " uid=" + message.uid);

Loading…
Cancel
Save