Check threads for multiple selection actions

This commit is contained in:
M66B 2019-07-25 07:58:19 +02:00
parent f2c454a744
commit e0a446a8a9
1 changed files with 15 additions and 11 deletions

View File

@ -1531,15 +1531,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (!result.folders.contains(message.folder)) if (!result.folders.contains(message.folder))
result.folders.add(message.folder); result.folders.add(message.folder);
if (message.ui_seen) List<EntityMessage> messages = db.message().getMessageByThread(
message.account, message.thread, threading ? null : id, null);
for (EntityMessage threaded : messages) {
if (threaded.ui_seen)
result.seen = true; result.seen = true;
else else
result.unseen = true; result.unseen = true;
if (message.ui_flagged) if (threaded.ui_flagged)
result.flagged = true; result.flagged = true;
else else
result.unflagged = true; result.unflagged = true;
}
EntityFolder folder = db.folder().getFolder(message.folder); EntityFolder folder = db.folder().getFolder(message.folder);
boolean isArchive = EntityFolder.ARCHIVE.equals(folder.type); boolean isArchive = EntityFolder.ARCHIVE.equals(folder.type);
@ -1697,9 +1701,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
for (long id : ids) { for (long id : ids) {
EntityMessage message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
if (message != null && message.ui_seen != seen) { if (message != null) {
List<EntityMessage> messages = db.message().getMessageByThread( List<EntityMessage> messages = db.message().getMessageByThread(
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)
EntityOperation.queue(context, threaded, EntityOperation.SEEN, seen); EntityOperation.queue(context, threaded, EntityOperation.SEEN, seen);
} }
@ -1754,7 +1758,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
EntityMessage message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
if (message != null) { if (message != null) {
List<EntityMessage> messages = db.message().getMessageByThread( List<EntityMessage> messages = db.message().getMessageByThread(
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)
EntityOperation.queue(context, threaded, EntityOperation.FLAG, flagged, color); EntityOperation.queue(context, threaded, EntityOperation.FLAG, flagged, color);
} }