Cleanup message & attachment files

This commit is contained in:
M66B
2018-08-21 14:37:46 +00:00
parent 3ef26e5e46
commit ae8eb762f8
3 changed files with 38 additions and 3 deletions

View File

@@ -34,11 +34,16 @@ public interface DaoAttachment {
" ORDER BY sequence")
LiveData<List<EntityAttachment>> liveAttachments(long id);
@Query("SELECT COUNT(attachment.id)" +
@Query("SELECT COUNT(id)" +
" FROM attachment" +
" WHERE message = :message")
int getAttachmentCount(long message);
@Query("SELECT COUNT(id)" +
" FROM attachment" +
" WHERE id = :id")
int countAttachment(long id);
@Query("SELECT * FROM attachment" +
" WHERE message = :message" +
" ORDER BY sequence")