Skip to content
Permalink
Browse files

use email from query result to display timestamp

We use server side ordering of query results. Threads are ordered by the time
stamp of the first matching email (not by the most recent email in that thread)

So a thread where only the first email is in a certain mailbox will be ordered
by the timestamp of that email. Therefor when displaying the timestamp we need
to pick that email.
  • Loading branch information
iNPUTmice committed Feb 10, 2020
1 parent 793e795 commit 5c31c0deed031017d53044a4da9f2d12993b226f
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/src/main/java/rs/ltt/android/entity/ThreadOverviewItem.java
@@ -20,6 +20,7 @@

import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
@@ -75,7 +76,7 @@ public String getSubject() {
}

public Date getReceivedAt() {
final Email email = Iterables.getLast(getOrderedEmails(), null);
final Email email = Iterables.tryFind(emails, e -> e != null && emailId.equals(e.id)).orNull();
return email == null ? null : email.receivedAt;
}

0 comments on commit 5c31c0d

Please sign in to comment.
You can’t perform that action at this time.