mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-24 08:38:51 -05:00
Merge pull request #49 from senab/master
Expose SenderAddress through ContentProvider. Issue: 3665
This commit is contained in:
commit
50e6218c1d
@ -60,6 +60,11 @@ public class MessageProvider extends ContentProvider {
|
||||
* <P>Type: TEXT</P>
|
||||
*/
|
||||
String SENDER = "sender";
|
||||
|
||||
/**
|
||||
* <P>Type: TEXT</P>
|
||||
*/
|
||||
String SENDER_ADDRESS = "senderAddress";
|
||||
|
||||
/**
|
||||
* <P>Type: TEXT</P>
|
||||
@ -179,6 +184,12 @@ public class MessageProvider extends ContentProvider {
|
||||
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> {
|
||||
@Override
|
||||
public String getField(final MessageInfoHolder source) {
|
||||
@ -290,6 +301,8 @@ public class MessageProvider extends ContentProvider {
|
||||
extractors.put(field, new SubjectExtractor());
|
||||
} else if (MessageColumns.SENDER.equals(field)) {
|
||||
extractors.put(field, new SenderExtractor());
|
||||
} else if (MessageColumns.SENDER_ADDRESS.equals(field)) {
|
||||
extractors.put(field, new SenderAddressExtractor());
|
||||
} else if (MessageColumns.SEND_DATE.equals(field)) {
|
||||
extractors.put(field, new SendDateExtractor());
|
||||
} else if (MessageColumns.PREVIEW.equals(field)) {
|
||||
@ -818,7 +831,8 @@ public class MessageProvider extends ContentProvider {
|
||||
MessageColumns.PREVIEW,
|
||||
MessageColumns.ACCOUNT,
|
||||
MessageColumns.URI,
|
||||
MessageColumns.DELETE_URI
|
||||
MessageColumns.DELETE_URI,
|
||||
MessageColumns.SENDER_ADDRESS
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user