Mark single message seen/unseen on snooze

pull/196/head
M66B 4 years ago
parent b247df8feb
commit 7e37572ebb

@ -7396,16 +7396,17 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
List<EntityMessage> messages = db.message().getMessagesByThread( List<EntityMessage> messages = db.message().getMessagesByThread(
account, thread, threading ? null : id, null); account, thread, threading ? null : id, null);
for (EntityMessage threaded : messages) for (EntityMessage threaded : messages) {
if (threaded.ui_unsnoozed && wakeup == null) db.message().setMessageUnsnoozed(threaded.id, false);
db.message().setMessageUnsnoozed(threaded.id, false); db.message().setMessageSnoozed(threaded.id, wakeup);
else { if (threaded.id.equals(id))
db.message().setMessageSnoozed(threaded.id, wakeup); EntityOperation.queue(context, threaded, EntityOperation.SEEN, true, false);
db.message().setMessageUiIgnored(threaded.id, true); else
if (!hide && flag_snoozed && threaded.folder.equals(message.folder)) db.message().setMessageUiIgnored(message.id, true);
EntityOperation.queue(context, threaded, EntityOperation.FLAG, wakeup != null); if (!hide && flag_snoozed && threaded.folder.equals(message.folder))
EntityMessage.snooze(context, threaded.id, wakeup); EntityOperation.queue(context, threaded, EntityOperation.FLAG, wakeup != null);
} EntityMessage.snooze(context, threaded.id, wakeup);
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {
@ -7462,17 +7463,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
continue; continue;
List<EntityMessage> messages = db.message().getMessagesByThread( List<EntityMessage> messages = db.message().getMessagesByThread(
message.account, message.thread, threading ? null : id, message.folder); message.account, message.thread, threading ? null : id, null);
for (EntityMessage threaded : messages) for (EntityMessage threaded : messages) {
if (threaded.ui_unsnoozed && wakeup == null) db.message().setMessageUnsnoozed(threaded.id, false);
db.message().setMessageUnsnoozed(threaded.id, false); db.message().setMessageSnoozed(threaded.id, wakeup);
else { if (threaded.id.equals(id))
db.message().setMessageSnoozed(threaded.id, wakeup); EntityOperation.queue(context, threaded, EntityOperation.SEEN, true, false);
else
db.message().setMessageUiIgnored(message.id, true); db.message().setMessageUiIgnored(message.id, true);
if (flag_snoozed && threaded.folder.equals(message.folder)) if (flag_snoozed && threaded.folder.equals(message.folder))
EntityOperation.queue(context, threaded, EntityOperation.FLAG, wakeup != null); EntityOperation.queue(context, threaded, EntityOperation.FLAG, wakeup != null);
EntityMessage.snooze(context, threaded.id, wakeup); EntityMessage.snooze(context, threaded.id, wakeup);
} }
} }
db.setTransactionSuccessful(); db.setTransactionSuccessful();

@ -519,9 +519,12 @@ public class ServiceUI extends IntentService {
} }
} }
} }
db.message().setMessageSnoozed(message.id, null); db.message().setMessageSnoozed(message.id, null);
db.message().setMessageUnsnoozed(message.id, true); if (!message.ui_ignored) {
EntityOperation.queue(this, message, EntityOperation.SEEN, false, false); db.message().setMessageUnsnoozed(message.id, true);
EntityOperation.queue(this, message, EntityOperation.SEEN, false, false);
}
} }
db.setTransactionSuccessful(); db.setTransactionSuccessful();

Loading…
Cancel
Save