mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Message threading fix
This commit is contained in:
parent
606bef05d7
commit
b2f8fecc0b
3 changed files with 5 additions and 2 deletions
|
@ -44,7 +44,7 @@ public interface DaoMessage {
|
|||
" FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE (NOT message.ui_hide OR :debug)" +
|
||||
" GROUP BY CASE WHEN message.thread IS NULL THEN message.id ELSE message.thread END" +
|
||||
" GROUP BY CASE WHEN message.thread IS NULL THEN message.id ELSE message.thread END, message.subject" +
|
||||
" HAVING SUM(CASE WHEN folder.type = '" + EntityFolder.INBOX + "' THEN 1 ELSE 0 END) > 0" +
|
||||
" ORDER BY message.received DESC")
|
||||
DataSource.Factory<Integer, TupleMessageEx> pagedUnifiedInbox(boolean debug);
|
||||
|
@ -57,7 +57,7 @@ public interface DaoMessage {
|
|||
" FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE (NOT message.ui_hide OR :debug)" +
|
||||
" GROUP BY CASE WHEN message.thread IS NULL THEN message.id ELSE message.thread END" +
|
||||
" GROUP BY CASE WHEN message.thread IS NULL THEN message.id ELSE message.thread END, message.subject" +
|
||||
" HAVING SUM(CASE WHEN folder.id = :folder THEN 1 ELSE 0 END) > 0" +
|
||||
" ORDER BY message.received DESC, message.sent DESC")
|
||||
DataSource.Factory<Integer, TupleMessageEx> pagedFolder(long folder, boolean debug);
|
||||
|
|
|
@ -542,6 +542,7 @@ public class FragmentCompose extends FragmentEx {
|
|||
draft = new EntityMessage();
|
||||
draft.account = account;
|
||||
draft.folder = drafts.id;
|
||||
draft.msgid = draft.generateMessageId();
|
||||
|
||||
if (ref != null) {
|
||||
draft.thread = ref.thread;
|
||||
|
|
|
@ -722,6 +722,8 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
try {
|
||||
JSONArray jargs = new JSONArray(op.args);
|
||||
EntityMessage message = db.message().getMessage(op.message);
|
||||
if (message == null)
|
||||
throw new MessageRemovedException();
|
||||
|
||||
if (EntityOperation.SEEN.equals(op.name))
|
||||
doSeen(folder, ifolder, message, jargs);
|
||||
|
|
Loading…
Reference in a new issue