mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Differentiate between normal and found threads
This commit is contained in:
parent
de21a65935
commit
5319d31c51
5 changed files with 15 additions and 7 deletions
|
@ -857,6 +857,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
Bundle args = new Bundle();
|
||||
args.putLong("account", intent.getLongExtra("account", -1));
|
||||
args.putString("thread", intent.getStringExtra("thread"));
|
||||
args.putBoolean("found", intent.getBooleanExtra("found", false));
|
||||
|
||||
FragmentMessages fragment = new FragmentMessages();
|
||||
fragment.setArguments(args);
|
||||
|
|
|
@ -548,7 +548,8 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
lbm.sendBroadcast(
|
||||
new Intent(ActivityView.ACTION_VIEW_THREAD)
|
||||
.putExtra("account", message.account)
|
||||
.putExtra("thread", message.thread));
|
||||
.putExtra("thread", message.thread)
|
||||
.putExtra("found", message.ui_found));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,13 +106,14 @@ public interface DaoMessage {
|
|||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE message.account = :account" +
|
||||
" AND message.thread = :thread" +
|
||||
" AND ui_found = :found" +
|
||||
" AND (NOT message.ui_hide OR :debug)" +
|
||||
" ORDER BY CASE" +
|
||||
" WHEN 'unread' = :sort THEN NOT message.ui_seen" +
|
||||
" WHEN 'starred' = :sort THEN message.ui_flagged" +
|
||||
" ELSE 0" +
|
||||
" END DESC, message.received DESC, message.sent DESC")
|
||||
DataSource.Factory<Integer, TupleMessageEx> pagedThread(long account, String thread, String sort, boolean debug);
|
||||
DataSource.Factory<Integer, TupleMessageEx> pagedThread(long account, String thread, boolean found, String sort, boolean debug);
|
||||
|
||||
@Query("SELECT COUNT(id)" +
|
||||
" FROM message" +
|
||||
|
|
|
@ -95,6 +95,7 @@ public class FragmentMessages extends FragmentEx {
|
|||
private long folder = -1;
|
||||
private long account = -1;
|
||||
private String thread = null;
|
||||
private boolean found = false;
|
||||
private String search = null;
|
||||
|
||||
private long primary = -1;
|
||||
|
@ -133,6 +134,7 @@ public class FragmentMessages extends FragmentEx {
|
|||
account = args.getLong("account", -1);
|
||||
folder = args.getLong("folder", -1);
|
||||
thread = args.getString("thread");
|
||||
found = args.getBoolean("found", false);
|
||||
search = args.getString("search");
|
||||
|
||||
if (TextUtils.isEmpty(search))
|
||||
|
@ -548,7 +550,8 @@ public class FragmentMessages extends FragmentEx {
|
|||
lbm.sendBroadcast(
|
||||
new Intent(ActivityView.ACTION_VIEW_THREAD)
|
||||
.putExtra("account", target.account)
|
||||
.putExtra("thread", target.thread));
|
||||
.putExtra("thread", target.thread)
|
||||
.putExtra("found", target.found));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
@ -1119,7 +1122,7 @@ public class FragmentMessages extends FragmentEx {
|
|||
|
||||
break;
|
||||
case THREAD:
|
||||
messages = new LivePagedListBuilder<>(db.message().pagedThread(account, thread, sort, debug), LOCAL_PAGE_SIZE).build();
|
||||
messages = new LivePagedListBuilder<>(db.message().pagedThread(account, thread, found, sort, debug), LOCAL_PAGE_SIZE).build();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -56,17 +56,19 @@ public class ViewModelMessages extends ViewModel {
|
|||
next = item;
|
||||
}
|
||||
return new Target[]{
|
||||
prev == null ? null : new Target(prev.account, prev.thread),
|
||||
next == null ? null : new Target(next.account, next.thread)};
|
||||
prev == null ? null : new Target(prev.account, prev.thread, prev.ui_found),
|
||||
next == null ? null : new Target(next.account, next.thread, next.ui_found)};
|
||||
}
|
||||
|
||||
class Target {
|
||||
long account;
|
||||
String thread;
|
||||
boolean found;
|
||||
|
||||
Target(long account, String thread) {
|
||||
Target(long account, String thread, boolean found) {
|
||||
this.account = account;
|
||||
this.thread = thread;
|
||||
this.found = found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue