From 3252002629518de13130c57a9d1f242ee88dd54e Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 14 Aug 2021 20:37:27 +0200 Subject: [PATCH] Rename MessageStore.setLastUpdated() to setLastChecked() --- .../src/main/java/com/fsck/k9/mailstore/K9BackendFolder.kt | 2 +- app/core/src/main/java/com/fsck/k9/mailstore/MessageStore.kt | 4 ++-- .../main/java/com/fsck/k9/storage/messages/K9MessageStore.kt | 4 ++-- .../com/fsck/k9/storage/messages/UpdateFolderOperations.kt | 2 +- .../fsck/k9/storage/messages/UpdateFolderOperationsTest.kt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/K9BackendFolder.kt b/app/core/src/main/java/com/fsck/k9/mailstore/K9BackendFolder.kt index e2f71c941..bdf027ba9 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/K9BackendFolder.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/K9BackendFolder.kt @@ -67,7 +67,7 @@ class K9BackendFolder( } override fun setLastChecked(timestamp: Long) { - messageStore.setLastUpdated(folderId, timestamp) + messageStore.setLastChecked(folderId, timestamp) } override fun setStatus(status: String?) { diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/MessageStore.kt b/app/core/src/main/java/com/fsck/k9/mailstore/MessageStore.kt index e59aeaebb..a2305d6f1 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/MessageStore.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/MessageStore.kt @@ -212,9 +212,9 @@ interface MessageStore { fun setMoreMessages(folderId: Long, moreMessages: MoreMessages) /** - * Update the 'last updated' state of a folder. + * Update the time when the folder was last checked for new messages. */ - fun setLastUpdated(folderId: Long, timestamp: Long) + fun setLastChecked(folderId: Long, timestamp: Long) /** * Update folder status message. diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStore.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStore.kt index 979f874e7..c8c5b1434 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStore.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/K9MessageStore.kt @@ -165,8 +165,8 @@ class K9MessageStore( updateFolderOperations.setMoreMessages(folderId, moreMessages) } - override fun setLastUpdated(folderId: Long, timestamp: Long) { - updateFolderOperations.setLastUpdated(folderId, timestamp) + override fun setLastChecked(folderId: Long, timestamp: Long) { + updateFolderOperations.setLastChecked(folderId, timestamp) } override fun setStatus(folderId: Long, status: String?) { diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/UpdateFolderOperations.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/UpdateFolderOperations.kt index cfa1921e3..06486aa2a 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/UpdateFolderOperations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/UpdateFolderOperations.kt @@ -65,7 +65,7 @@ internal class UpdateFolderOperations(private val lockableDatabase: LockableData setString(folderId = folderId, columnName = "more_messages", value = moreMessages.databaseName) } - fun setLastUpdated(folderId: Long, timestamp: Long) { + fun setLastChecked(folderId: Long, timestamp: Long) { lockableDatabase.execute(false) { db -> val contentValues = ContentValues().apply { put("last_updated", timestamp) diff --git a/app/storage/src/test/java/com/fsck/k9/storage/messages/UpdateFolderOperationsTest.kt b/app/storage/src/test/java/com/fsck/k9/storage/messages/UpdateFolderOperationsTest.kt index 6bf2f2bd8..83bc4fe5f 100644 --- a/app/storage/src/test/java/com/fsck/k9/storage/messages/UpdateFolderOperationsTest.kt +++ b/app/storage/src/test/java/com/fsck/k9/storage/messages/UpdateFolderOperationsTest.kt @@ -135,7 +135,7 @@ class UpdateFolderOperationsTest : RobolectricTest() { fun `update late updated state`() { val folderId = sqliteDatabase.createFolder(lastUpdated = 23) - updateFolderOperations.setLastUpdated(folderId = folderId, timestamp = 42) + updateFolderOperations.setLastChecked(folderId = folderId, timestamp = 42) val folder = sqliteDatabase.readFolders().first() assertThat(folder.id).isEqualTo(folderId)