Experiment

This commit is contained in:
M66B 2020-04-27 17:41:49 +02:00
parent 86a7f49f8d
commit 86e589a904
2 changed files with 16 additions and 3 deletions

View File

@ -334,6 +334,11 @@ public interface DaoMessage {
" AND (id = :id OR msgid = :msgid)")
List<EntityMessage> getMessagesBySimilarity(long account, long id, String msgid);
@Query("SELECT * FROM message" +
" WHERE account = :account" +
" AND hash = :hash")
List<EntityMessage> getMessagesByHash(long account, String hash);
@Query("SELECT COUNT(*) FROM message" +
" WHERE folder = :folder" +
" AND msgid = :msgid")

View File

@ -299,10 +299,18 @@ public class EntityOperation {
return;
} else if (DELETE.equals(name))
} else if (DELETE.equals(name)) {
db.message().setMessageUiHide(message.id, true);
else if (ATTACHMENT.equals(name))
/*
if (message.hash != null) {
List<EntityMessage> sames = db.message().getMessagesByHash(message.account, message.hash);
for (EntityMessage same : sames) {
db.message().setMessageUiHide(same.id, true);
queue(context, same.account, same.folder, same.id, name, jargs);
}
}
*/
} else if (ATTACHMENT.equals(name))
db.attachment().setProgress(jargs.getLong(0), 0);
queue(context, message.account, message.folder, message.id, name, jargs);