Unhide on full sync only

pull/146/head
M66B 6 years ago
parent 21dd0f7bda
commit 1a879b0b05

@ -887,7 +887,7 @@ public class ServiceSynchronize extends LifecycleService {
long id;
try {
db.beginTransaction();
id = synchronizeMessage(ServiceSynchronize.this, folder, ifolder, (IMAPMessage) imessage, false);
id = synchronizeMessage(ServiceSynchronize.this, folder, ifolder, (IMAPMessage) imessage, false, false);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
@ -970,7 +970,7 @@ public class ServiceSynchronize extends LifecycleService {
long id;
try {
db.beginTransaction();
id = synchronizeMessage(ServiceSynchronize.this, folder, ifolder, (IMAPMessage) e.getMessage(), false);
id = synchronizeMessage(ServiceSynchronize.this, folder, ifolder, (IMAPMessage) e.getMessage(), false, false);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
@ -1909,7 +1909,7 @@ public class ServiceSynchronize extends LifecycleService {
for (int j = isub.length - 1; j >= 0; j--)
try {
db.beginTransaction();
ids[from + j] = synchronizeMessage(this, folder, ifolder, (IMAPMessage) isub[j], false);
ids[from + j] = synchronizeMessage(this, folder, ifolder, (IMAPMessage) isub[j], false, true);
db.setTransactionSuccessful();
Thread.sleep(20);
} catch (MessageRemovedException ex) {
@ -1975,7 +1975,7 @@ public class ServiceSynchronize extends LifecycleService {
}
}
static Long synchronizeMessage(Context context, EntityFolder folder, IMAPFolder ifolder, IMAPMessage imessage, boolean found) throws MessagingException, IOException {
static Long synchronizeMessage(Context context, EntityFolder folder, IMAPFolder ifolder, IMAPMessage imessage, boolean found, boolean full) throws MessagingException, IOException {
long uid = ifolder.getUID(imessage);
if (imessage.isExpunged()) {
@ -2152,7 +2152,7 @@ public class ServiceSynchronize extends LifecycleService {
" keywords=" + TextUtils.join(" ", keywords));
}
if (!update && message.ui_hide) {
if (message.ui_hide && full) {
update = true;
message.ui_hide = false;
db.message().updateMessage(message);

@ -200,7 +200,7 @@ public class ViewModelBrowse extends ViewModel {
EntityMessage message = db.message().getMessageByUid(state.fid, uid, state.search != null);
if (message == null) {
ServiceSynchronize.synchronizeMessage(
state.context, folder, state.ifolder, (IMAPMessage) isub[j], state.search != null);
state.context, folder, state.ifolder, (IMAPMessage) isub[j], state.search != null, false);
count++;
}
} catch (MessageRemovedException ex) {

Loading…
Cancel
Save