mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-12 03:54:28 +02:00
Added sent by address
This commit is contained in:
@@ -336,6 +336,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private ImageButton ibNotifyContact;
|
||||
private ImageButton ibAddContact;
|
||||
|
||||
private TextView tvSubmitterTitle;
|
||||
private TextView tvFromExTitle;
|
||||
private TextView tvToTitle;
|
||||
private TextView tvReplyToTitle;
|
||||
@@ -346,6 +347,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private TextView tvReceivedTitle;
|
||||
private TextView tvSizeExTitle;
|
||||
|
||||
private TextView tvSubmitter;
|
||||
private TextView tvFromEx;
|
||||
private TextView tvTo;
|
||||
private TextView tvReplyTo;
|
||||
@@ -496,6 +498,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
ibNotifyContact = vsBody.findViewById(R.id.ibNotifyContact);
|
||||
ibAddContact = vsBody.findViewById(R.id.ibAddContact);
|
||||
|
||||
tvSubmitterTitle = vsBody.findViewById(R.id.tvSubmitterTitle);
|
||||
tvFromExTitle = vsBody.findViewById(R.id.tvFromExTitle);
|
||||
tvToTitle = vsBody.findViewById(R.id.tvToTitle);
|
||||
tvReplyToTitle = vsBody.findViewById(R.id.tvReplyToTitle);
|
||||
@@ -506,6 +509,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
tvReceivedTitle = vsBody.findViewById(R.id.tvReceivedTitle);
|
||||
tvSizeExTitle = vsBody.findViewById(R.id.tvSizeExTitle);
|
||||
|
||||
tvSubmitter = vsBody.findViewById(R.id.tvSubmitter);
|
||||
tvFromEx = vsBody.findViewById(R.id.tvFromEx);
|
||||
tvTo = vsBody.findViewById(R.id.tvTo);
|
||||
tvReplyTo = vsBody.findViewById(R.id.tvReplyTo);
|
||||
@@ -1095,6 +1099,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
ibNotifyContact.setVisibility(View.GONE);
|
||||
ibAddContact.setVisibility(View.GONE);
|
||||
|
||||
tvSubmitterTitle.setVisibility(View.GONE);
|
||||
tvFromExTitle.setVisibility(View.GONE);
|
||||
tvToTitle.setVisibility(View.GONE);
|
||||
tvReplyToTitle.setVisibility(View.GONE);
|
||||
@@ -1105,6 +1110,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
tvReceivedTitle.setVisibility(View.GONE);
|
||||
tvSizeExTitle.setVisibility(View.GONE);
|
||||
|
||||
tvSubmitter.setVisibility(View.GONE);
|
||||
tvFromEx.setVisibility(View.GONE);
|
||||
tvTo.setVisibility(View.GONE);
|
||||
tvReplyTo.setVisibility(View.GONE);
|
||||
@@ -1268,12 +1274,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
ibExpanderAddress.setImageLevel(show_addresses ? 0 /* less */ : 1 /* more */);
|
||||
ibExpanderAddress.setContentDescription(context.getString(show_addresses ? R.string.title_accessibility_hide_addresses : R.string.title_accessibility_show_addresses));
|
||||
|
||||
String submitter = MessageHelper.formatAddresses(message.submitter);
|
||||
String from = MessageHelper.formatAddresses(message.senders);
|
||||
String to = MessageHelper.formatAddresses(message.to);
|
||||
String replyto = MessageHelper.formatAddresses(message.reply);
|
||||
String cc = MessageHelper.formatAddresses(message.cc);
|
||||
String bcc = MessageHelper.formatAddresses(message.bcc);
|
||||
|
||||
tvSubmitterTitle.setVisibility(show_addresses && !TextUtils.isEmpty(submitter) ? View.VISIBLE : View.GONE);
|
||||
tvSubmitter.setVisibility(show_addresses && !TextUtils.isEmpty(submitter) ? View.VISIBLE : View.GONE);
|
||||
tvSubmitter.setText(submitter);
|
||||
|
||||
tvFromExTitle.setVisibility(show_addresses && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
|
||||
tvFromEx.setVisibility(show_addresses && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
|
||||
tvFromEx.setText(from);
|
||||
|
||||
@@ -1489,6 +1489,7 @@ class Core {
|
||||
message.dkim = MessageHelper.getAuthentication("dkim", authentication);
|
||||
message.spf = MessageHelper.getAuthentication("spf", authentication);
|
||||
message.dmarc = MessageHelper.getAuthentication("dmarc", authentication);
|
||||
message.submitter = helper.getSender();
|
||||
message.from = helper.getFrom();
|
||||
message.to = helper.getTo();
|
||||
message.cc = helper.getCc();
|
||||
@@ -1517,6 +1518,9 @@ class Core {
|
||||
message.ui_ignored = false;
|
||||
message.ui_browsed = false;
|
||||
|
||||
if (MessageHelper.equal(message.submitter, message.from))
|
||||
message.submitter = null;
|
||||
|
||||
if (message.size == null && message.total != null)
|
||||
message.size = message.total;
|
||||
|
||||
@@ -2090,6 +2094,7 @@ class Core {
|
||||
message.dkim = MessageHelper.getAuthentication("dkim", authentication);
|
||||
message.spf = MessageHelper.getAuthentication("spf", authentication);
|
||||
message.dmarc = MessageHelper.getAuthentication("dmarc", authentication);
|
||||
message.submitter = helper.getSender();
|
||||
message.from = helper.getFrom();
|
||||
message.to = helper.getTo();
|
||||
message.cc = helper.getCc();
|
||||
@@ -2119,6 +2124,9 @@ class Core {
|
||||
message.ui_ignored = seen;
|
||||
message.ui_browsed = browsed;
|
||||
|
||||
if (MessageHelper.equal(message.submitter, message.from))
|
||||
message.submitter = null;
|
||||
|
||||
// Borrow reply name from sender name
|
||||
if (message.from != null && message.from.length == 1 &&
|
||||
message.reply != null && message.reply.length == 1) {
|
||||
|
||||
@@ -60,7 +60,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
||||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 136,
|
||||
version = 137,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
@@ -1328,6 +1328,13 @@ public abstract class DB extends RoomDatabase {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("ALTER TABLE `certificate` ADD COLUMN `intermediate` INTEGER NOT NULL DEFAULT 0");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(136, 137) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("ALTER TABLE `message` ADD COLUMN `submitter` TEXT");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ public class EntityMessage implements Serializable {
|
||||
public Boolean mx = null;
|
||||
public String avatar; // lookup URI from sender
|
||||
public String sender; // sort key
|
||||
public Address[] submitter;
|
||||
public Address[] from;
|
||||
public Address[] to;
|
||||
public Address[] cc;
|
||||
|
||||
@@ -873,6 +873,10 @@ public class MessageHelper {
|
||||
return addresses;
|
||||
}
|
||||
|
||||
Address[] getSender() throws MessagingException {
|
||||
return getAddressHeader("Sender");
|
||||
}
|
||||
|
||||
Address[] getFrom() throws MessagingException {
|
||||
Address[] address = getAddressHeader("From");
|
||||
if (address == null)
|
||||
|
||||
Reference in New Issue
Block a user