1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-10-31 15:45:08 -04:00
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.
This commit is contained in:
Daniel Applebaum 2009-02-28 17:40:39 +00:00
parent 91573e19ac
commit 19c93d1816
3 changed files with 27 additions and 6 deletions

View File

@ -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>

View File

@ -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;

View File

@ -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)
{
this.sender = Address.toFriendly(message
.getRecipients(RecipientType.TO));
Address[] addrs = message.getFrom();
if (addrs.length > 0 && mAccount.isAnIdentity(addrs[0]))
{
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)
{