1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-31 07:10:14 -05:00

Add a fromMe method on messages

This commit is contained in:
Jesse Vincent 2012-10-02 17:50:47 -07:00
parent f1d985dc2b
commit 0c34a21ff0
3 changed files with 20 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public abstract class Message implements Part, Body {
public abstract boolean toMe();
public abstract boolean ccMe();
public abstract boolean bccMe();
public abstract boolean fromMe();
public abstract long getId();
public abstract String getPreview();

View File

@ -605,6 +605,10 @@ public class MimeMessage extends Message {
return false;
}
public boolean fromMe() {
return false;
}
public long getId() {
return Long.parseLong(mUid); //or maybe .mMessageId?
}

View File

@ -2919,8 +2919,13 @@ public class LocalStore extends Store implements Serializable {
private boolean mToMeCalculated = false;
private boolean mCcMeCalculated = false;
private boolean mFromMeCalculated = false;
private boolean mToMe = false;
private boolean mCcMe = false;
private boolean mFromMe = false;
private boolean mHeadersLoaded = false;
private boolean mMessageDirty = false;
@ -3118,6 +3123,16 @@ public class LocalStore extends Store implements Serializable {
}
public boolean fromMe() {
if (!mFromMeCalculated) {
if (mAccount.isAnIdentity(getFrom())) {
mFromMe = true;
mFromMeCalculated = true;
}
}
return mFromMe;
}
public boolean toMe() {
try {