Show sender/subject on permanent delete

This commit is contained in:
M66B 2021-03-03 19:24:02 +01:00
parent ef9e7b0616
commit 8f64b0c72d
3 changed files with 14 additions and 0 deletions

View File

@ -4041,6 +4041,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onActionDelete(TupleMessageEx message) { private void onActionDelete(TupleMessageEx message) {
Bundle aargs = new Bundle(); Bundle aargs = new Bundle();
aargs.putString("question", context.getString(R.string.title_ask_delete)); aargs.putString("question", context.getString(R.string.title_ask_delete));
aargs.putString("remark", message.getRemark());
aargs.putLong("id", message.id); aargs.putLong("id", message.id);
aargs.putBoolean("warning", true); aargs.putBoolean("warning", true);
@ -4559,6 +4560,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onMenuDelete(final TupleMessageEx message) { private void onMenuDelete(final TupleMessageEx message) {
Bundle aargs = new Bundle(); Bundle aargs = new Bundle();
aargs.putString("question", context.getString(R.string.title_ask_delete)); aargs.putString("question", context.getString(R.string.title_ask_delete));
aargs.putString("remark", message.getRemark());
aargs.putLong("id", message.id); aargs.putLong("id", message.id);
aargs.putBoolean("warning", true); aargs.putBoolean("warning", true);

View File

@ -2267,6 +2267,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private void onSwipeDelete(@NonNull TupleMessageEx message) { private void onSwipeDelete(@NonNull TupleMessageEx message) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("question", getString(R.string.title_ask_delete)); args.putString("question", getString(R.string.title_ask_delete));
args.putString("remark", message.getRemark());
args.putLong("id", message.id); args.putLong("id", message.id);
args.putBoolean("warning", true); args.putBoolean("warning", true);

View File

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color; import android.graphics.Color;
import android.text.TextUtils;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.room.Ignore; import androidx.room.Ignore;
@ -88,6 +89,16 @@ public class TupleMessageEx extends EntityMessage {
this.keyword_colors = color.toArray(new Integer[0]); this.keyword_colors = color.toArray(new Integer[0]);
} }
String getRemark() {
StringBuilder sb = new StringBuilder();
sb.append(MessageHelper.formatAddresses(from));
if (!TextUtils.isEmpty(subject)) {
if (sb.length() > 0)
sb.append('\n');
sb.append(subject);
}
return sb.toString();
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {