mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 00:58:50 -05:00
move toMe and ccMe into LocalMessage from MessageInfoHolder
This commit is contained in:
parent
580f47998d
commit
75108f4078
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user