Add unread count to synthesized cursor

This commit is contained in:
Moxie Marlinspike 2017-11-14 11:47:15 -08:00
parent 1986e58c5f
commit 682abbf66b

View File

@ -42,7 +42,7 @@ public class ConversationListLoader extends AbstractCursorLoader {
if (archivedCount > 0) { if (archivedCount > 0) {
MatrixCursor switchToArchiveCursor = new MatrixCursor(new String[] { MatrixCursor switchToArchiveCursor = new MatrixCursor(new String[] {
ThreadDatabase.ID, ThreadDatabase.DATE, ThreadDatabase.MESSAGE_COUNT, ThreadDatabase.ID, ThreadDatabase.DATE, ThreadDatabase.MESSAGE_COUNT,
ThreadDatabase.ADDRESS, ThreadDatabase.SNIPPET, ThreadDatabase.READ, ThreadDatabase.ADDRESS, ThreadDatabase.SNIPPET, ThreadDatabase.READ, ThreadDatabase.UNREAD_COUNT,
ThreadDatabase.TYPE, ThreadDatabase.SNIPPET_TYPE, ThreadDatabase.SNIPPET_URI, ThreadDatabase.TYPE, ThreadDatabase.SNIPPET_TYPE, ThreadDatabase.SNIPPET_URI,
ThreadDatabase.ARCHIVED, ThreadDatabase.STATUS, ThreadDatabase.DELIVERY_RECEIPT_COUNT, ThreadDatabase.ARCHIVED, ThreadDatabase.STATUS, ThreadDatabase.DELIVERY_RECEIPT_COUNT,
ThreadDatabase.EXPIRES_IN, ThreadDatabase.LAST_SEEN, ThreadDatabase.READ_RECEIPT_COUNT}, 1); ThreadDatabase.EXPIRES_IN, ThreadDatabase.LAST_SEEN, ThreadDatabase.READ_RECEIPT_COUNT}, 1);
@ -50,12 +50,12 @@ public class ConversationListLoader extends AbstractCursorLoader {
if (cursorList.get(0).getCount() <= 0) { if (cursorList.get(0).getCount() <= 0) {
switchToArchiveCursor.addRow(new Object[] {-1L, System.currentTimeMillis(), archivedCount, switchToArchiveCursor.addRow(new Object[] {-1L, System.currentTimeMillis(), archivedCount,
"-1", null, 1, ThreadDatabase.DistributionTypes.INBOX_ZERO, "-1", null, 1, 0, ThreadDatabase.DistributionTypes.INBOX_ZERO,
0, null, 0, -1, 0, 0, 0, -1}); 0, null, 0, -1, 0, 0, 0, -1});
} }
switchToArchiveCursor.addRow(new Object[] {-1L, System.currentTimeMillis(), archivedCount, switchToArchiveCursor.addRow(new Object[] {-1L, System.currentTimeMillis(), archivedCount,
"-1", null, 1, ThreadDatabase.DistributionTypes.ARCHIVE, "-1", null, 1, 0, ThreadDatabase.DistributionTypes.ARCHIVE,
0, null, 0, -1, 0, 0, 0, -1}); 0, null, 0, -1, 0, 0, 0, -1});
cursorList.add(switchToArchiveCursor); cursorList.add(switchToArchiveCursor);