1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Expose SenderAddress through ContentProvider. Issue: 3665

This commit is contained in:
Chris Banes 2011-09-01 11:57:06 +01:00
parent f6a647d7b0
commit caa02b16eb

View File

@ -60,6 +60,11 @@ public class MessageProvider extends ContentProvider {
* <P>Type: TEXT</P> * <P>Type: TEXT</P>
*/ */
String SENDER = "sender"; String SENDER = "sender";
/**
* <P>Type: TEXT</P>
*/
String SENDER_ADDRESS = "senderAddress";
/** /**
* <P>Type: TEXT</P> * <P>Type: TEXT</P>
@ -179,6 +184,12 @@ public class MessageProvider extends ContentProvider {
return source.sender; return source.sender;
} }
} }
public static class SenderAddressExtractor implements FieldExtractor<MessageInfoHolder, String> {
@Override
public String getField(final MessageInfoHolder source) {
return source.senderAddress;
}
}
public static class AccountExtractor implements FieldExtractor<MessageInfoHolder, String> { public static class AccountExtractor implements FieldExtractor<MessageInfoHolder, String> {
@Override @Override
public String getField(final MessageInfoHolder source) { public String getField(final MessageInfoHolder source) {
@ -290,6 +301,8 @@ public class MessageProvider extends ContentProvider {
extractors.put(field, new SubjectExtractor()); extractors.put(field, new SubjectExtractor());
} else if (MessageColumns.SENDER.equals(field)) { } else if (MessageColumns.SENDER.equals(field)) {
extractors.put(field, new SenderExtractor()); extractors.put(field, new SenderExtractor());
} else if (MessageColumns.SENDER_ADDRESS.equals(field)) {
extractors.put(field, new SenderAddressExtractor());
} else if (MessageColumns.SEND_DATE.equals(field)) { } else if (MessageColumns.SEND_DATE.equals(field)) {
extractors.put(field, new SendDateExtractor()); extractors.put(field, new SendDateExtractor());
} else if (MessageColumns.PREVIEW.equals(field)) { } else if (MessageColumns.PREVIEW.equals(field)) {
@ -814,6 +827,7 @@ public class MessageProvider extends ContentProvider {
MessageColumns._ID, MessageColumns._ID,
MessageColumns.SEND_DATE, MessageColumns.SEND_DATE,
MessageColumns.SENDER, MessageColumns.SENDER,
MessageColumns.SENDER_ADDRESS,
MessageColumns.SUBJECT, MessageColumns.SUBJECT,
MessageColumns.PREVIEW, MessageColumns.PREVIEW,
MessageColumns.ACCOUNT, MessageColumns.ACCOUNT,