New messages: check changes early

pull/212/head
M66B 2 years ago
parent f19ea639fb
commit 5aac79a205

@ -5263,6 +5263,13 @@ class Core {
" ignored=" + message.ui_ignored + " ignored=" + message.ui_ignored +
" hide=" + message.ui_hide); " hide=" + message.ui_hide);
else { else {
// Prevent reappearing notifications
EntityMessage msg = db.message().getMessage(message.id);
if (msg == null || msg.ui_ignored) {
Log.i("Notify skip id=" + message.id + " msg=" + (msg != null));
continue;
}
Integer current = newMessages.get(group); Integer current = newMessages.get(group);
newMessages.put(group, current == null ? 1 : current + 1); newMessages.put(group, current == null ? 1 : current + 1);
@ -5296,11 +5303,6 @@ class Core {
remove.remove(id); remove.remove(id);
Log.i("Notify existing=" + id); Log.i("Notify existing=" + id);
} else { } else {
EntityMessage msg = db.message().getMessage(message.id);
if (msg == null || msg.ui_ignored) {
Log.i("Notify skip id=" + message.id + " msg=" + (msg != null));
continue;
}
boolean existing = remove.contains(-id); boolean existing = remove.contains(-id);
if (existing) { if (existing) {
if (message.content && notify_preview) { if (message.content && notify_preview) {

Loading…
Cancel
Save