Merge "Add attachments to ui messages"
This commit is contained in:
commit
081582122c
@ -2242,6 +2242,24 @@ outer:
|
|||||||
}
|
}
|
||||||
values.put(UIProvider.MessageColumns.ALWAYS_SHOW_IMAGES, autoShowImages);
|
values.put(UIProvider.MessageColumns.ALWAYS_SHOW_IMAGES, autoShowImages);
|
||||||
|
|
||||||
|
// Add attachments...
|
||||||
|
Attachment[] atts = Attachment.restoreAttachmentsWithMessageId(context, messageId);
|
||||||
|
if (atts.length > 0) {
|
||||||
|
ArrayList<com.android.mail.providers.Attachment> uiAtts =
|
||||||
|
new ArrayList<com.android.mail.providers.Attachment>();
|
||||||
|
for (Attachment att: atts) {
|
||||||
|
com.android.mail.providers.Attachment uiAtt =
|
||||||
|
new com.android.mail.providers.Attachment();
|
||||||
|
uiAtt.name = att.mFileName;
|
||||||
|
uiAtt.contentType = att.mMimeType;
|
||||||
|
uiAtt.size = (int)att.mSize;
|
||||||
|
uiAtt.uri = uiUri("uiattachment", att.mId);
|
||||||
|
uiAtts.add(uiAtt);
|
||||||
|
}
|
||||||
|
values.put(UIProvider.MessageColumns.ATTACHMENTS,
|
||||||
|
com.android.mail.providers.Attachment.toJSONArray(uiAtts));
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder sb = genSelect(sMessageViewMap, uiProjection, values);
|
StringBuilder sb = genSelect(sMessageViewMap, uiProjection, values);
|
||||||
sb.append(" FROM " + Message.TABLE_NAME + "," + Body.TABLE_NAME + " WHERE " +
|
sb.append(" FROM " + Message.TABLE_NAME + "," + Body.TABLE_NAME + " WHERE " +
|
||||||
Body.MESSAGE_KEY + "=" + Message.TABLE_NAME + "." + Message.RECORD_ID + " AND " +
|
Body.MESSAGE_KEY + "=" + Message.TABLE_NAME + "." + Message.RECORD_ID + " AND " +
|
||||||
|
Loading…
Reference in New Issue
Block a user