diff --git a/app/src/main/java/com/infomaniak/mail/data/api/FlatteningSubBodiesSerializer.kt b/app/src/main/java/com/infomaniak/mail/data/api/FlatteningSubBodiesSerializer.kt index 67bf476cc9..362ccee58e 100644 --- a/app/src/main/java/com/infomaniak/mail/data/api/FlatteningSubBodiesSerializer.kt +++ b/app/src/main/java/com/infomaniak/mail/data/api/FlatteningSubBodiesSerializer.kt @@ -38,7 +38,7 @@ object FlatteningSubBodiesSerializer : JsonTransformingSerializer = mutableListOf(), ): List { - val remoteSubBody = inputList.removeFirst() as? JsonObject + val remoteSubBody = inputList.removeAt(0) as? JsonObject val remoteBody = remoteSubBody?.get("body") as? JsonObject val remoteSubBodies = remoteBody?.get("subBody") as? JsonArray diff --git a/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/FolderController.kt b/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/FolderController.kt index 56fa14ff93..e5ae656aa1 100644 --- a/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/FolderController.kt +++ b/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/FolderController.kt @@ -200,7 +200,7 @@ class FolderController @Inject constructor( suspend fun updateFolderAndChildren(id: String, realm: Realm, onUpdate: (Folder) -> Unit) { tailrec fun updateChildrenRecursively(inputList: MutableList) { - val folder = inputList.removeFirst() + val folder = inputList.removeAt(0) onUpdate(folder) inputList.addAll(folder.children) diff --git a/app/src/main/java/com/infomaniak/mail/data/models/message/Message.kt b/app/src/main/java/com/infomaniak/mail/data/models/message/Message.kt index c07d6c1d63..50e1421ec0 100644 --- a/app/src/main/java/com/infomaniak/mail/data/models/message/Message.kt +++ b/app/src/main/java/com/infomaniak/mail/data/models/message/Message.kt @@ -324,7 +324,7 @@ class Message : RealmObject { fun shouldBeExpanded(index: Int, lastIndex: Int) = !isDraft && (!isSeen || index == lastIndex) fun toThread() = Thread().apply { - uid = this@Message.uid // TODO: Check if we can use random UUID instead ? + uid = this@Message.uid folderId = this@Message.folderId messagesIds += this@Message.messageIds messages += this@Message diff --git a/app/src/main/java/com/infomaniak/mail/ui/main/search/RecentSearchAdapter.kt b/app/src/main/java/com/infomaniak/mail/ui/main/search/RecentSearchAdapter.kt index 318a3429ea..d496d621ad 100644 --- a/app/src/main/java/com/infomaniak/mail/ui/main/search/RecentSearchAdapter.kt +++ b/app/src/main/java/com/infomaniak/mail/ui/main/search/RecentSearchAdapter.kt @@ -68,7 +68,7 @@ class RecentSearchAdapter( while (count() > MAX_HISTORY_COUNT) { notifyItemRemoved(lastIndex) - removeLast() + removeAt(lastIndex) } return true diff --git a/app/src/main/java/com/infomaniak/mail/utils/extensions/Extensions.kt b/app/src/main/java/com/infomaniak/mail/utils/extensions/Extensions.kt index e91c5133ce..524157679d 100644 --- a/app/src/main/java/com/infomaniak/mail/utils/extensions/Extensions.kt +++ b/app/src/main/java/com/infomaniak/mail/utils/extensions/Extensions.kt @@ -337,7 +337,7 @@ fun List.flattenFolderChildrenAndRemoveMessages(dismissHiddenChildren: B outputList: MutableList = mutableListOf(), ): List { - val folder = inputList.removeFirst() + val folder = inputList.removeAt(0) val children = if (folder.isManaged()) { outputList.add(folder.copyFromRealm(depth = 1u))