move toMe and ccMe into LocalMessage from MessageInfoHolder

This commit is contained in:
Jesse Vincent 2010-11-27 04:03:10 +00:00
parent 580f47998d
commit 75108f4078
4 changed files with 60 additions and 23 deletions

View file

@ -21,8 +21,6 @@ public class MessageInfoHolder
public boolean downloaded;
public boolean partially_downloaded;
public boolean dirty;
public boolean toMe;
public boolean ccMe;
public LocalMessage message;
public FolderInfoHolder folder;
public boolean selected;

View file

@ -2814,11 +2814,11 @@ public class MessageList
private String recipientSigil (MessageInfoHolder message)
{
if (message.toMe)
if (message.message.toMe())
{
return getString(R.string.messagelist_sent_to_me_sigil);
}
else if (message.ccMe)
else if (message.message.ccMe())
{
return getString(R.string.messagelist_sent_cc_me_sigil);
}

View file

@ -99,25 +99,6 @@ public class MessageHelper
for (Address address : message.getRecipients(RecipientType.TO))
{
if (account.isAnIdentity(address))
{
target.toMe = true;
}
}
if (target.toMe == false )
{
for(Address address : message.getRecipients(RecipientType.CC))
{
if (account.isAnIdentity(address))
{
target.ccMe = true;
}
}
}
target.uid = message.getUid();

View file

@ -5918,6 +5918,12 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati
private String mPreview = "";
private boolean mToMeCalculated = false;
private boolean mCcMeCalculated = false;
private boolean mToMe = false;
private boolean mCcMe = false;
private boolean mHeadersLoaded = false;
private boolean mMessageDirty = false;
@ -6135,6 +6141,58 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati
public boolean toMe()
{
try
{ if (mToMeCalculated == false) {
for (Address address : getRecipients(RecipientType.TO))
{
if (mAccount.isAnIdentity(address))
{
mToMe = true;
mToMeCalculated = true;
}
}
}
} catch (MessagingException e) {
// do something better than ignore this
// getRecipients can throw a messagingexception
}
return mToMe;
}
public boolean ccMe()
{
try {
if (mCcMeCalculated == false) {
for(Address address : getRecipients(RecipientType.CC))
{
if (mAccount.isAnIdentity(address))
{
mCcMe = true;
mCcMeCalculated = true;
}
}
}
} catch (MessagingException e) {
// do something better than ignore this
// getRecipients can throw a messagingexception
}
return mCcMe;
}
public void setFlagInternal(Flag flag, boolean set) throws MessagingException
{
super.setFlag(flag, set);