fix quote attachments

This commit is contained in:
Ryan ZHAO
2021-03-05 13:31:40 +11:00
parent 3b2ea4e95d
commit 4218073a69
5 changed files with 43 additions and 42 deletions

View File

@@ -84,7 +84,8 @@ class DatabaseAttachmentProvider(context: Context, helper: SQLCipherOpenHelper)
}
override fun getAttachmentIDsFor(messageID: Long): List<Long> {
return DatabaseFactory.getAttachmentDatabase(context).getAttachmentsForMessage(messageID).map {
return DatabaseFactory.getAttachmentDatabase(context).getAttachmentsForMessage(messageID).mapNotNull {
if (it.isQuote) return@mapNotNull null
it.attachmentId.rowId
}
}

View File

@@ -45,6 +45,7 @@ public class PagingMediaLoader extends AsyncLoader<Pair<Cursor, Integer>> {
return new Pair<>(cursor, leftIsRecent ? cursor.getPosition() : cursor.getCount() - 1 - cursor.getPosition());
}
}
cursor.close();
return null;
}