Browse Source

Message threading fix

main
M66B 6 years ago
parent
commit
b2f8fecc0b
3 changed files with 5 additions and 2 deletions
  1. +2
    -2
      app/src/main/java/eu/faircode/email/DaoMessage.java
  2. +1
    -0
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  3. +2
    -0
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 2
- 2
app/src/main/java/eu/faircode/email/DaoMessage.java View File

@ -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);


+ 1
- 0
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -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;


+ 2
- 0
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -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…
Cancel
Save