Use snoozed time as default for duration dialog

pull/209/head
M66B 2 years ago
parent af74fe7744
commit 6466b81fd6

@ -5875,6 +5875,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
args.putLong("folder", message.folder);
args.putString("thread", message.thread);
args.putLong("id", message.id);
if (message.ui_snoozed != null)
args.putLong("time", message.ui_snoozed);
args.putBoolean("finish", true);
FragmentDialogDuration fragment = new FragmentDialogDuration();

@ -1274,11 +1274,24 @@ public class FragmentMessages extends FragmentBase
}
private void onActionSnooze() {
Long time = null;
List<TupleMessageEx> list = adapter.getCurrentList();
if (list != null)
for (TupleMessageEx message : list)
if (message != null && message.ui_snoozed != null) {
if (time == null || message.ui_snoozed < time || message.id.equals(id))
time = message.ui_snoozed;
if (message.id.equals(id))
break;
}
Bundle args = new Bundle();
args.putString("title", getString(R.string.title_snooze));
args.putLong("account", account);
args.putString("thread", thread);
args.putLong("id", id);
if (time != null)
args.putLong("time", time);
args.putBoolean("finish", true);
FragmentDialogDuration fragment = new FragmentDialogDuration();
@ -2922,6 +2935,8 @@ public class FragmentMessages extends FragmentBase
args.putLong("account", message.account);
args.putString("thread", message.thread);
args.putLong("id", message.id);
if (message.ui_snoozed != null)
args.putLong("time", message.ui_snoozed);
args.putBoolean("finish", false);
FragmentDialogDuration fragment = new FragmentDialogDuration();

Loading…
Cancel
Save