Skip to content

Commit

Permalink
chore: rename MessageOrder to ResultOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic committed Nov 29, 2024
1 parent 257b9b4 commit 6218ba7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions chat-android/src/main/java/com/ably/chat/ChatApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ private fun QueryOptions.toParams() = buildList {
Param(
"direction",
when (orderBy) {
QueryOptions.MessageOrder.NewestFirst -> "backwards"
QueryOptions.MessageOrder.OldestFirst -> "forwards"
QueryOptions.ResultOrder.NewestFirst -> "backwards"
QueryOptions.ResultOrder.OldestFirst -> "forwards"
},
),
)
Expand Down
10 changes: 5 additions & 5 deletions chat-android/src/main/java/com/ably/chat/Messages.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package com.ably.chat

import com.ably.chat.QueryOptions.MessageOrder.NewestFirst
import com.ably.chat.QueryOptions.ResultOrder.NewestFirst
import com.google.gson.JsonObject
import io.ably.lib.realtime.AblyRealtime
import io.ably.lib.realtime.ChannelState
Expand Down Expand Up @@ -49,7 +49,7 @@ interface Messages : EmitsDiscontinuities {
start: Long? = null,
end: Long? = null,
limit: Int = 100,
orderBy: QueryOptions.MessageOrder = NewestFirst,
orderBy: QueryOptions.ResultOrder = NewestFirst,
): PaginatedResult<Message>

/**
Expand Down Expand Up @@ -109,12 +109,12 @@ data class QueryOptions(
/**
* The order of messages in the query result.
*/
val orderBy: MessageOrder = NewestFirst,
val orderBy: ResultOrder = NewestFirst,
) {
/**
* Represents direction to query messages in.
*/
enum class MessageOrder {
enum class ResultOrder {
/**
* The response will include messages from the start of the time window to the end.
*/
Expand Down Expand Up @@ -306,7 +306,7 @@ internal class DefaultMessages(
)
}

override suspend fun get(start: Long?, end: Long?, limit: Int, orderBy: QueryOptions.MessageOrder): PaginatedResult<Message> =
override suspend fun get(start: Long?, end: Long?, limit: Int, orderBy: QueryOptions.ResultOrder): PaginatedResult<Message> =
chatApi.getMessages(
roomId,
QueryOptions(start, end, limit, orderBy),
Expand Down

0 comments on commit 6218ba7

Please sign in to comment.