Skip to content

Commit

Permalink
Simplify getMessagesUids()
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Jan 24, 2024
1 parent 480906c commit 7d97a76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/infomaniak/mail/data/api/ApiRoutes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ object ApiRoutes {
}

fun getMessagesUids(mailboxUuid: String, folderId: String, info: PaginationInfo?): String {
val endpoint = "${getMessages(mailboxUuid, folderId)}/messages-uids"
val messages = "?messages=${Utils.PAGE_SIZE}"
val endpoint = "${getMessages(mailboxUuid, folderId)}/messages-uids?messages=${Utils.PAGE_SIZE}"
val offset = info?.offsetUid?.let { "&uid_offset=$it" } ?: ""
val direction = info?.direction?.let { "&direction=$it" } ?: ""
return "${endpoint}${messages}${offset}${direction}"

return "${endpoint}${offset}${direction}"
}

fun getMessagesByUids(mailboxUuid: String, folderId: String, uids: List<Int>): String {
Expand Down

0 comments on commit 7d97a76

Please sign in to comment.