Added option to disable trashing sent messages / conversation

pull/212/head
M66B 2 years ago
parent 52d8b0b402
commit ca727b254e

@ -351,6 +351,7 @@ public class FragmentMessages extends FragmentBase
private boolean threading; private boolean threading;
private boolean swipenav; private boolean swipenav;
private boolean seekbar; private boolean seekbar;
private boolean thread_sent_trash;
private boolean actionbar; private boolean actionbar;
private int actionbar_delete_id; private int actionbar_delete_id;
private int actionbar_archive_id; private int actionbar_archive_id;
@ -498,6 +499,7 @@ public class FragmentMessages extends FragmentBase
args.getBoolean("force_threading")); args.getBoolean("force_threading"));
swipenav = prefs.getBoolean("swipenav", true); swipenav = prefs.getBoolean("swipenav", true);
seekbar = prefs.getBoolean("seekbar", false); seekbar = prefs.getBoolean("seekbar", false);
thread_sent_trash = prefs.getBoolean("thread_sent_trash", true);
actionbar = prefs.getBoolean("actionbar", true); actionbar = prefs.getBoolean("actionbar", true);
boolean actionbar_swap = prefs.getBoolean("actionbar_swap", false); boolean actionbar_swap = prefs.getBoolean("actionbar_swap", false);
actionbar_delete_id = (actionbar_swap ? R.id.action_archive : R.id.action_delete); actionbar_delete_id = (actionbar_swap ? R.id.action_archive : R.id.action_delete);
@ -1385,7 +1387,7 @@ public class FragmentMessages extends FragmentBase
!targetFolder.id.equals(threaded.folder) && !targetFolder.id.equals(threaded.folder) &&
(!filter_archive || !EntityFolder.ARCHIVE.equals(sourceFolder.type)) && (!filter_archive || !EntityFolder.ARCHIVE.equals(sourceFolder.type)) &&
!EntityFolder.DRAFTS.equals(sourceFolder.type) && !EntityFolder.OUTBOX.equals(sourceFolder.type) && !EntityFolder.DRAFTS.equals(sourceFolder.type) && !EntityFolder.OUTBOX.equals(sourceFolder.type) &&
(!EntityFolder.SENT.equals(sourceFolder.type) || EntityFolder.TRASH.equals(targetFolder.type)) && (!EntityFolder.SENT.equals(sourceFolder.type) || !EntityFolder.TRASH.equals(targetFolder.type) || thread_sent_trash) &&
!EntityFolder.TRASH.equals(sourceFolder.type) && !EntityFolder.JUNK.equals(sourceFolder.type)) !EntityFolder.TRASH.equals(sourceFolder.type) && !EntityFolder.JUNK.equals(sourceFolder.type))
result.add(new MessageTarget(context, threaded, account, sourceFolder, account, targetFolder)); result.add(new MessageTarget(context, threaded, account, sourceFolder, account, targetFolder));
} }
@ -6887,6 +6889,7 @@ public class FragmentMessages extends FragmentBase
args.putLong("account", account); args.putLong("account", account);
args.putString("thread", thread); args.putString("thread", thread);
args.putLong("id", id); args.putLong("id", id);
args.putBoolean("thread_sent_trash", thread_sent_trash);
args.putBoolean("filter_archive", filter_archive); args.putBoolean("filter_archive", filter_archive);
new SimpleTask<ActionData>() { new SimpleTask<ActionData>() {
@ -6895,6 +6898,7 @@ public class FragmentMessages extends FragmentBase
long aid = args.getLong("account"); long aid = args.getLong("account");
String thread = args.getString("thread"); String thread = args.getString("thread");
long id = args.getLong("id"); long id = args.getLong("id");
boolean thread_sent_trash = args.getBoolean("thread_sent_trash");
boolean filter_archive = args.getBoolean("filter_archive"); boolean filter_archive = args.getBoolean("filter_archive");
EntityAccount account; EntityAccount account;
@ -6931,7 +6935,7 @@ public class FragmentMessages extends FragmentBase
if (!folder.read_only && if (!folder.read_only &&
!EntityFolder.DRAFTS.equals(folder.type) && !EntityFolder.DRAFTS.equals(folder.type) &&
!EntityFolder.OUTBOX.equals(folder.type) && !EntityFolder.OUTBOX.equals(folder.type) &&
// allow sent (!EntityFolder.SENT.equals(folder.type) || thread_sent_trash) &&
!EntityFolder.TRASH.equals(folder.type) && !EntityFolder.TRASH.equals(folder.type) &&
!EntityFolder.JUNK.equals(folder.type)) !EntityFolder.JUNK.equals(folder.type))
trashable = true; trashable = true;

@ -151,7 +151,7 @@ public class FragmentOptions extends FragmentBase {
"collapse_quotes", "image_placeholders", "inline_images", "collapse_quotes", "image_placeholders", "inline_images",
"seekbar", "actionbar", "actionbar_swap", "actionbar_color", "group_category", "seekbar", "actionbar", "actionbar_swap", "actionbar_color", "group_category",
"autoscroll", "swipenav", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose", "autoscroll", "swipenav", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose",
"swipe_reply", "thread_sent_trash", "swipe_reply",
"language_detection", "language_detection",
"quick_filter", "quick_scroll", "quick_actions", "quick_filter", "quick_scroll", "quick_actions",
"experiments", "debug", "log_level", "test1", "test2", "test3", "test4", "test5", "experiments", "debug", "log_level", "test1", "test2", "test3", "test4", "test5",

@ -102,6 +102,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoRead; private SwitchCompat swAutoRead;
private SwitchCompat swAutoUnflag; private SwitchCompat swAutoUnflag;
private SwitchCompat swResetImportance; private SwitchCompat swResetImportance;
private SwitchCompat swThreadSentTrash;
private SwitchCompat swFlagSnoozed; private SwitchCompat swFlagSnoozed;
private SwitchCompat swAutoImportant; private SwitchCompat swAutoImportant;
private SwitchCompat swResetSnooze; private SwitchCompat swResetSnooze;
@ -123,8 +124,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple", "autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked", "autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked",
"undo_timeout", "undo_timeout",
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance", "reset_snooze", "auto_block_sender", "autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance", "thread_sent_trash",
"swipe_reply", "default_folder" "reset_snooze", "auto_block_sender", "swipe_reply", "default_folder"
}; };
@Override @Override
@ -177,6 +178,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoRead = view.findViewById(R.id.swAutoRead); swAutoRead = view.findViewById(R.id.swAutoRead);
swAutoUnflag = view.findViewById(R.id.swAutoUnflag); swAutoUnflag = view.findViewById(R.id.swAutoUnflag);
swResetImportance = view.findViewById(R.id.swResetImportance); swResetImportance = view.findViewById(R.id.swResetImportance);
swThreadSentTrash = view.findViewById(R.id.swThreadSentTrash);
swFlagSnoozed = view.findViewById(R.id.swFlagSnoozed); swFlagSnoozed = view.findViewById(R.id.swFlagSnoozed);
swAutoImportant = view.findViewById(R.id.swAutoImportant); swAutoImportant = view.findViewById(R.id.swAutoImportant);
swResetSnooze = view.findViewById(R.id.swResetSnooze); swResetSnooze = view.findViewById(R.id.swResetSnooze);
@ -514,6 +516,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
} }
}); });
swThreadSentTrash.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("thread_sent_trash", checked).apply();
}
});
swFlagSnoozed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swFlagSnoozed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -690,6 +699,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoRead.setChecked(prefs.getBoolean("autoread", false)); swAutoRead.setChecked(prefs.getBoolean("autoread", false));
swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false)); swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false));
swResetImportance.setChecked(prefs.getBoolean("reset_importance", false)); swResetImportance.setChecked(prefs.getBoolean("reset_importance", false));
swThreadSentTrash.setChecked(prefs.getBoolean("thread_sent_trash", true));
swFlagSnoozed.setChecked(prefs.getBoolean("flag_snoozed", false)); swFlagSnoozed.setChecked(prefs.getBoolean("flag_snoozed", false));
swAutoImportant.setChecked(prefs.getBoolean("auto_important", false)); swAutoImportant.setChecked(prefs.getBoolean("auto_important", false));
swResetSnooze.setChecked(prefs.getBoolean("reset_snooze", true)); swResetSnooze.setChecked(prefs.getBoolean("reset_snooze", true));

@ -701,6 +701,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoUnflag" app:layout_constraintTop_toBottomOf="@id/swAutoUnflag"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swThreadSentTrash"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_thread_sent_trash"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swResetImportance"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

@ -652,6 +652,7 @@
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string> <string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
<string name="title_advanced_autounstar">Automatically remove stars from messages on moving messages</string> <string name="title_advanced_autounstar">Automatically remove stars from messages on moving messages</string>
<string name="title_advanced_reset_importance">Reset importance on moving messages</string> <string name="title_advanced_reset_importance">Reset importance on moving messages</string>
<string name="title_advanced_thread_sent_trash">When trashing a conversation, also trash sent messages</string>
<string name="title_advanced_star_snoozed">Automatically add star on snoozing messages</string> <string name="title_advanced_star_snoozed">Automatically add star on snoozing messages</string>
<string name="title_advanced_auto_important">Automatically make starred messages important</string> <string name="title_advanced_auto_important">Automatically make starred messages important</string>
<string name="title_advanced_cancel_snooze">Cancel snooze on moving messages</string> <string name="title_advanced_cancel_snooze">Cancel snooze on moving messages</string>

Loading…
Cancel
Save