2010-08-17 22:49:13 -04:00
|
|
|
package com.fsck.k9.activity;
|
|
|
|
|
2011-01-18 18:54:49 -05:00
|
|
|
import java.util.Date;
|
|
|
|
import com.fsck.k9.helper.MessageHelper;
|
2010-11-26 23:02:56 -05:00
|
|
|
import com.fsck.k9.mail.store.LocalStore.LocalMessage;
|
2010-08-17 22:49:13 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public class MessageInfoHolder {
|
2010-08-17 22:49:13 -04:00
|
|
|
public String date;
|
|
|
|
public Date compareDate;
|
|
|
|
public String compareSubject;
|
2010-08-30 10:37:34 -04:00
|
|
|
public CharSequence sender;
|
2010-08-17 22:49:13 -04:00
|
|
|
public String senderAddress;
|
|
|
|
public String compareCounterparty;
|
|
|
|
public String[] recipients;
|
|
|
|
public String uid;
|
|
|
|
public boolean read;
|
|
|
|
public boolean answered;
|
|
|
|
public boolean flagged;
|
|
|
|
public boolean downloaded;
|
|
|
|
public boolean partially_downloaded;
|
2010-10-08 01:34:33 -04:00
|
|
|
public boolean dirty;
|
2010-11-26 23:02:56 -05:00
|
|
|
public LocalMessage message;
|
2010-08-17 22:49:13 -04:00
|
|
|
public FolderInfoHolder folder;
|
|
|
|
public boolean selected;
|
|
|
|
public String account;
|
|
|
|
public String uri;
|
|
|
|
|
|
|
|
// Empty constructor for comparison
|
2011-02-06 17:09:48 -05:00
|
|
|
public MessageInfoHolder() {
|
2010-08-17 22:49:13 -04:00
|
|
|
this.selected = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (o instanceof MessageInfoHolder == false) {
|
2010-08-17 22:49:13 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
MessageInfoHolder other = (MessageInfoHolder)o;
|
|
|
|
return message.equals(other.message);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-02-06 17:09:48 -05:00
|
|
|
public int hashCode() {
|
2010-08-17 22:49:13 -04:00
|
|
|
return uid.hashCode();
|
|
|
|
}
|
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public String getDate(MessageHelper messageHelper) {
|
|
|
|
if (date == null) {
|
2010-10-13 06:53:08 -04:00
|
|
|
date = messageHelper.formatDate(message.getSentDate());
|
|
|
|
}
|
|
|
|
return date;
|
|
|
|
}
|
2010-08-17 22:49:13 -04:00
|
|
|
}
|