Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19c93d18 authored by Daniel Applebaum's avatar Daniel Applebaum
Browse files

Issue 10

All messages in all folders that were sent from the email address
associated with the account display the recipient, preceeded by To:,
instead of the sender.

parent 91573e19
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ Welcome to K-9 Mail setup. K-9 is an open source email client for Android based
    <string name="message_compose_downloading_attachments_toast">Some attachments were not downloaded. They will be downloaded automatically before this message is sent.</string>
    <string name="message_compose_attachments_skipped_toast">Some attachments cannot be forwarded because they have not downloaded.</string>

    <string name="folder_message_list_to_label">To:</string>
    
    <string name="message_view_to_label">To:</string>
    <string name="message_view_attachment_view_action">Open</string>
    <string name="message_view_attachment_download_action">Save</string>
+7 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import java.io.Serializable;
import java.util.Arrays;
import java.util.UUID;

import com.android.email.mail.Address;
import com.android.email.mail.Folder;
import com.android.email.mail.MessagingException;
import com.android.email.mail.Store;
@@ -411,6 +412,12 @@ public class Account implements Serializable {
    	
    }
    
    // TODO: When there are multiple identities, this method should try all of them
    public boolean isAnIdentity(Address addr)
    {
      return getEmail().equals(addr.getAddress());
    }

    public int getDisplayCount() {
        if (mDisplayCount == -1) {
            this.mDisplayCount = Email.DEFAULT_VISIBLE_LIMIT;
+18 −6
Original line number Diff line number Diff line
@@ -2055,6 +2055,8 @@ public class FolderMessageList extends ExpandableListActivity

            public String sender;
            
            public String compareCounterparty;
            
            public String[] recipients;

            public boolean hasAttachments;
@@ -2095,13 +2097,23 @@ public class FolderMessageList extends ExpandableListActivity
                    this.read = message.isSet(Flag.SEEN);
                    this.answered = message.isSet(Flag.ANSWERED);
                    this.flagged = message.isSet(Flag.FLAGGED);
					if (folder.outbox)
                    
                    Address[] addrs = message.getFrom();
                      if (addrs.length > 0 && mAccount.isAnIdentity(addrs[0]))
                      {
						this.sender = Address.toFriendly(message
						
						
						this.compareCounterparty = Address.toFriendly(message
                .getRecipients(RecipientType.TO));
						
						this.sender = getString(R.string.folder_message_list_to_label) + this.compareCounterparty;
						
					} else
					{
                        this.sender = Address.toFriendly(message.getFrom());
                        this.sender = Address.toFriendly(addrs);
                        
                        this.compareCounterparty = this.sender;
                        
                    }
                    this.subject = message.getSubject();
                    this.uid = message.getUid();
@@ -2134,7 +2146,7 @@ public class FolderMessageList extends ExpandableListActivity
			  }
			  else if (sortType == SORT_TYPE.SORT_SENDER)
			  {
			    comparison = this.sender.toLowerCase().compareTo(o.sender.toLowerCase());
			    comparison = this.compareCounterparty.toLowerCase().compareTo(o.compareCounterparty.toLowerCase());
			  }
			  else if (sortType == SORT_TYPE.SORT_FLAGGED)
			  {