1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Added readed field to MessageProvider to indicate if message was

readed yet.
This commit is contained in:
João Pedro Taveira 2011-04-11 20:34:23 +01:00
parent 939660faf4
commit 591d7a3c6f

View File

@ -49,6 +49,7 @@ import com.fsck.k9.mail.store.LocalStore;
public class MessageProvider extends ContentProvider {
public static interface MessageColumns extends BaseColumns {
/**
* The number of milliseconds since Jan. 1, 1970, midnight GMT.
*
@ -71,6 +72,11 @@ public class MessageProvider extends ContentProvider {
*/
String PREVIEW = "preview";
/**
* <P>Type: BOOLEAN</P>
*/
String READED = "readed";
String ACCOUNT = "account";
String URI = "uri";
String DELETE_URI = "delUri";
@ -180,6 +186,14 @@ public class MessageProvider extends ContentProvider {
return source.message.getFolder().getAccount().getDescription();
}
}
public static class ReadedExtractor implements FieldExtractor<MessageInfoHolder, Boolean> {
@Override
public Boolean getField(final MessageInfoHolder source) {
return source.read;
}
}
/**
* @deprecated having an incremential value has no real interest,
@ -288,6 +302,8 @@ public class MessageProvider extends ContentProvider {
extractors.put(field, new DeleteUriExtractor());
} else if (MessageColumns.ACCOUNT.equals(field)) {
extractors.put(field, new AccountExtractor());
} else if (MessageColumns.READED.equals(field)) {
extractors.put(field, new ReadedExtractor());
} else if (MessageColumns.INCREMENT.equals(field)) {
extractors.put(field, new IncrementExtractor());
}
@ -803,6 +819,7 @@ public class MessageProvider extends ContentProvider {
MessageColumns.SUBJECT,
MessageColumns.PREVIEW,
MessageColumns.ACCOUNT,
MessageColumns.READED,
MessageColumns.URI,
MessageColumns.DELETE_URI
};