mirror of https://github.com/M66B/FairEmail.git
Fixed search on server for messages already stored locally
This commit is contained in:
parent
64493bb573
commit
a4949c6473
|
@ -91,7 +91,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
@Override
|
||||
public void run() {
|
||||
Log.i(Helper.TAG, "Boundary close");
|
||||
DB.getInstance(context).message().deleteFoundMessages();
|
||||
try {
|
||||
if (istore != null)
|
||||
istore.close();
|
||||
|
@ -207,11 +206,13 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
try {
|
||||
long uid = ifolder.getUID(isub[j]);
|
||||
Log.i(Helper.TAG, "Boundary sync uid=" + uid);
|
||||
if (db.message().getMessageByUid(fid, uid) == null) {
|
||||
EntityMessage message = db.message().getMessageByUid(fid, uid);
|
||||
if (message == null) {
|
||||
ServiceSynchronize.synchronizeMessage(context, folder, ifolder, (IMAPMessage) isub[j], search != null);
|
||||
count++;
|
||||
loaded++;
|
||||
}
|
||||
} else
|
||||
db.message().setMessageFound(message.id, true);
|
||||
} catch (MessageRemovedException ex) {
|
||||
Log.w(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
} catch (FolderClosedException ex) {
|
||||
|
|
|
@ -241,7 +241,4 @@ public interface DaoMessage {
|
|||
|
||||
@Query("DELETE FROM message WHERE folder = :folder AND received < :received AND NOT uid IS NULL")
|
||||
int deleteMessagesBefore(long folder, long received);
|
||||
|
||||
@Query("DELETE FROM message WHERE ui_found")
|
||||
int deleteFoundMessages();
|
||||
}
|
Loading…
Reference in New Issue