diff --git a/app/src/main/java/eu/faircode/email/DaoAccount.java b/app/src/main/java/eu/faircode/email/DaoAccount.java index 8a7f2ff38a..d8a6a62e35 100644 --- a/app/src/main/java/eu/faircode/email/DaoAccount.java +++ b/app/src/main/java/eu/faircode/email/DaoAccount.java @@ -86,10 +86,6 @@ public interface DaoAccount { " WHERE account.synchronize) AS operations") LiveData liveStats(); - @Query("SELECT COUNT(operation.id) FROM operation" + - " WHERE operation.name = '" + EntityOperation.SEND + "'") - LiveData liveUnsent(); - @Query("SELECT account.id, swipe_left, l.type AS left_type, swipe_right, r.type AS right_type" + " FROM account" + " LEFT JOIN folder l ON l.id = account.swipe_left" + diff --git a/app/src/main/java/eu/faircode/email/DaoOperation.java b/app/src/main/java/eu/faircode/email/DaoOperation.java index 10e0c74e3e..786db60752 100644 --- a/app/src/main/java/eu/faircode/email/DaoOperation.java +++ b/app/src/main/java/eu/faircode/email/DaoOperation.java @@ -65,6 +65,10 @@ public interface DaoOperation { @Query(GET_OPS_FOLDER) LiveData> liveOperations(long folder); + @Query("SELECT COUNT(operation.id) FROM operation" + + " WHERE operation.name = '" + EntityOperation.SEND + "'") + LiveData liveUnsent(); + @Query("SELECT * FROM operation ORDER BY id") List getOperations(); diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index 351acb8bad..74b3eb78d9 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -76,7 +76,7 @@ public class ServiceSend extends LifecycleService { DB db = DB.getInstance(this); - db.account().liveUnsent().observe(this, new Observer() { + db.operation().liveUnsent().observe(this, new Observer() { @Override public void onChanged(Integer unsent) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);