mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 06:08:25 -05:00
lift hasAttachments to LocalMessage
This commit is contained in:
parent
ae7ce4de7b
commit
f9981dcf7c
@ -3,6 +3,7 @@ import com.fsck.k9.helper.MessageHelper;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fsck.k9.mail.Message;
|
||||
import com.fsck.k9.mail.store.LocalStore.LocalMessage;
|
||||
|
||||
public class MessageInfoHolder
|
||||
{
|
||||
@ -15,7 +16,6 @@ public class MessageInfoHolder
|
||||
public String compareCounterparty;
|
||||
public String preview;
|
||||
public String[] recipients;
|
||||
public boolean hasAttachments;
|
||||
public String uid;
|
||||
public boolean read;
|
||||
public boolean answered;
|
||||
@ -25,7 +25,7 @@ public class MessageInfoHolder
|
||||
public boolean dirty;
|
||||
public boolean toMe;
|
||||
public boolean ccMe;
|
||||
public Message message;
|
||||
public LocalMessage message;
|
||||
public FolderInfoHolder folder;
|
||||
public boolean selected;
|
||||
public String account;
|
||||
|
@ -152,7 +152,7 @@ public class MessageList
|
||||
@Override
|
||||
public int compare(MessageInfoHolder object1, MessageInfoHolder object2)
|
||||
{
|
||||
return (object1.hasAttachments ? 0 : 1) - (object2.hasAttachments ? 0 : 1);
|
||||
return (object1.message.hasAttachments() ? 0 : 1) - (object2.message.hasAttachments() ? 0 : 1);
|
||||
}
|
||||
|
||||
}
|
||||
@ -2805,7 +2805,7 @@ public class MessageList
|
||||
holder.subject.setCompoundDrawablesWithIntrinsicBounds(
|
||||
message.answered ? mAnsweredIcon : null, // left
|
||||
null, // top
|
||||
message.hasAttachments ? mAttachmentIcon : null, // right
|
||||
message.message.hasAttachments() ? mAttachmentIcon : null, // right
|
||||
null); // bottom
|
||||
holder.position = position;
|
||||
}
|
||||
|
@ -2243,7 +2243,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
CharSequence ccText = Address.toFriendly(message.getRecipients(RecipientType.CC), contacts);
|
||||
|
||||
int color = mAccount.getChipColor();
|
||||
boolean hasAttachments = ((LocalMessage) message).getAttachmentCount() > 0;
|
||||
boolean hasAttachments = ((LocalMessage) message).hasAttachments();
|
||||
boolean unread = !message.isSet(Flag.SEEN);
|
||||
|
||||
mHandler.setHeaders(subjectText,
|
||||
|
@ -57,6 +57,7 @@ public class MessageHelper
|
||||
try
|
||||
{
|
||||
LocalMessage message = (LocalMessage) m;
|
||||
target.message = message;
|
||||
Date date = message.getSentDate();
|
||||
target.compareDate = message.getSentDate();
|
||||
if (target.compareDate == null)
|
||||
@ -66,8 +67,6 @@ public class MessageHelper
|
||||
|
||||
target.folder = folder;
|
||||
|
||||
target.hasAttachments = message.getAttachmentCount() > 0;
|
||||
|
||||
target.read = message.isSet(Flag.SEEN);
|
||||
target.answered = message.isSet(Flag.ANSWERED);
|
||||
target.flagged = message.isSet(Flag.FLAGGED);
|
||||
@ -122,7 +121,6 @@ public class MessageHelper
|
||||
target.subject = message.getSubject();
|
||||
|
||||
target.uid = message.getUid();
|
||||
target.message = m;
|
||||
target.preview = message.getPreview();
|
||||
|
||||
target.account = account.getDescription();
|
||||
|
@ -224,4 +224,5 @@ public abstract class Message implements Part, Body
|
||||
MessageReference tmpReference = makeMessageReference();
|
||||
return tmpReference.equals(ref);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6048,7 +6048,15 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati
|
||||
mMessageDirty = true;
|
||||
}
|
||||
|
||||
|
||||
public boolean hasAttachments()
|
||||
{
|
||||
if (mAttachmentCount > 0) {
|
||||
return true;
|
||||
} else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getAttachmentCount()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user