From 76f789748924fb38b5a13f81de6adbdb0a28bdf6 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 29 Oct 2019 09:46:39 +0100 Subject: [PATCH] Batched search --- .../email/BoundaryCallbackMessages.java | 80 +++++++++++-------- .../java/eu/faircode/email/DaoMessage.java | 5 +- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java index 5678c4431c..6852e1ec2d 100644 --- a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java +++ b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java @@ -77,6 +77,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback matchMessages(Long folder, String find, Boolean seen, Boolean flagged, Boolean snoozed); + " ORDER BY message.received DESC" + + " LIMIT :limit OFFSET :offset") + List matchMessages(Long folder, String find, Boolean seen, Boolean flagged, Boolean snoozed, int limit, int offset); @Query("SELECT id" + " FROM message" +