Move single messages in single message mode

pull/146/head
M66B 6 years ago
parent 3bf1f2b2e5
commit 5e6692f972

@ -163,8 +163,9 @@ public interface DaoMessage {
" FROM message" +
" WHERE account = :account" +
" AND thread = :thread" +
" AND (:id IS NULL OR message.id = :id)" +
" AND ui_found = :found")
List<EntityMessage> getMessageByThread(long account, String thread, boolean found);
List<EntityMessage> getMessageByThread(long account, String thread, Long id, boolean found);
@Query("SELECT message.* FROM message" +
" JOIN folder ON folder.id = message.folder" +

@ -486,7 +486,7 @@ public class FragmentMessages extends FragmentEx {
if (thread) {
List<EntityMessage> messages = db.message().getMessageByThread(
message.account, message.thread, message.ui_found);
message.account, message.thread, threading ? null : id, message.ui_found);
for (EntityMessage threaded : messages) {
if (!threaded.ui_hide && threaded.folder.equals(message.folder))
result.ids.add(threaded.id);
@ -751,7 +751,7 @@ public class FragmentMessages extends FragmentEx {
for (long id : ids) {
EntityMessage message = db.message().getMessage(id);
List<EntityMessage> messages = db.message().getMessageByThread(
message.account, message.thread, message.ui_found);
message.account, message.thread, threading ? null : id, message.ui_found);
for (EntityMessage threaded : messages)
if (threaded.folder.equals(message.folder)) {
result.ids.add(threaded.id);
@ -1469,7 +1469,7 @@ public class FragmentMessages extends FragmentEx {
result.target = db.folder().getFolderByType(account, folderType);
List<EntityMessage> messages = db.message().getMessageByThread(account, thread, found);
List<EntityMessage> messages = db.message().getMessageByThread(account, thread, threading ? null : id, found);
for (EntityMessage message : messages)
if (message.uid != null && !result.target.id.equals(message.folder)) {
result.ids.add(message.id);

Loading…
Cancel
Save