mirror of https://github.com/M66B/FairEmail.git
Sort on sender: show email/name
This commit is contained in:
parent
2acf49e955
commit
cdb3a782f0
|
@ -7040,7 +7040,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
this.check_blocklist = prefs.getBoolean("check_blocklist", false);
|
||||
|
||||
this.email_format = ("sender".equals(sort)
|
||||
? MessageHelper.AddressFormat.EMAIL_ONLY
|
||||
? MessageHelper.AddressFormat.EMAIL_NAME
|
||||
: MessageHelper.getAddressFormat(context));
|
||||
this.prefer_contact = prefs.getBoolean("prefer_contact", false);
|
||||
this.only_contact = prefs.getBoolean("only_contact", false);
|
||||
|
@ -7711,7 +7711,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (!sort.equals(this.sort)) {
|
||||
this.sort = sort;
|
||||
this.email_format = ("sender".equals(sort)
|
||||
? MessageHelper.AddressFormat.EMAIL_ONLY
|
||||
? MessageHelper.AddressFormat.EMAIL_NAME
|
||||
: MessageHelper.getAddressFormat(context));
|
||||
properties.refresh();
|
||||
// Needed to redraw item decorators / add/remove size
|
||||
|
|
|
@ -2721,7 +2721,7 @@ public class MessageHelper {
|
|||
}
|
||||
}
|
||||
|
||||
enum AddressFormat {NAME_ONLY, EMAIL_ONLY, NAME_EMAIL}
|
||||
enum AddressFormat {NAME_ONLY, EMAIL_ONLY, NAME_EMAIL, EMAIL_NAME}
|
||||
|
||||
static AddressFormat getAddressFormat(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
@ -2792,6 +2792,8 @@ public class MessageHelper {
|
|||
|
||||
if (format == AddressFormat.NAME_EMAIL && !TextUtils.isEmpty(email))
|
||||
formatted.add(personal + " <" + email + ">");
|
||||
else if (format == AddressFormat.EMAIL_NAME && !TextUtils.isEmpty(email))
|
||||
formatted.add("<" + email + "> " + personal);
|
||||
else
|
||||
formatted.add(personal);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue