Refactoring

This commit is contained in:
M66B 2019-02-09 12:19:23 +00:00
parent 0cbe9d311a
commit aa3f4a4990
1 changed files with 6 additions and 14 deletions

View File

@ -338,18 +338,6 @@ public class ServiceSynchronize extends LifecycleService {
break;
case "clear":
executor.submit(new Runnable() {
@Override
public void run() {
try {
DB.getInstance(ServiceSynchronize.this).message().ignoreAll();
} catch (Throwable ex) {
Log.e(ex);
}
}
});
break;
case "seen":
case "archive":
case "trash":
@ -362,12 +350,16 @@ public class ServiceSynchronize extends LifecycleService {
try {
db.beginTransaction();
long id = Long.parseLong(parts[1]);
long id = (parts.length > 1 ? Long.parseLong(parts[1]) : -1);
EntityMessage message = db.message().getMessage(id);
if (message == null)
if (id > 0 && message == null)
return;
switch (parts[0]) {
case "clear":
db.message().ignoreAll();
break;
case "seen":
EntityOperation.queue(ServiceSynchronize.this, db, message, EntityOperation.SEEN, true);
break;