Skip to content

Commit

Permalink
Add room_types filter and room_type response to /publicRooms, a…
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuly committed Nov 1, 2022
1 parent 5552b1c commit 98b3dd5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.folivo.trixnity.core.model.RoomAliasId
import net.folivo.trixnity.core.model.RoomId
import net.folivo.trixnity.core.model.events.m.room.CreateEventContent
import net.folivo.trixnity.core.model.events.m.room.JoinRulesEventContent

@Serializable
Expand All @@ -22,6 +23,7 @@ data class GetPublicRoomsResponse(
@SerialName("name") val name: String? = null,
@SerialName("num_joined_members") val joinedMembersCount: Long,
@SerialName("room_id") val roomId: RoomId,
@SerialName("room_type") val roomType: CreateEventContent.RoomType? = null,
@SerialName("topic") val topic: String? = null,
@SerialName("world_readable") val worldReadable: Boolean,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import net.folivo.trixnity.core.HttpMethod
import net.folivo.trixnity.core.HttpMethodType.POST
import net.folivo.trixnity.core.MatrixEndpoint
import net.folivo.trixnity.core.model.UserId
import net.folivo.trixnity.core.model.events.m.room.CreateEventContent

/**
* @see <a href="https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3publicrooms">matrix spec</a>
Expand All @@ -28,7 +29,8 @@ data class GetPublicRoomsWithFilter(
) {
@Serializable
data class Filter(
@SerialName("generic_search_term") val genericSearchTerm: String? = null
@SerialName("generic_search_term") val genericSearchTerm: String? = null,
@SerialName("room_types") val roomTypes: Set<CreateEventContent.RoomType?>? = null,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.folivo.trixnity.core.model.RoomAliasId
import net.folivo.trixnity.core.model.RoomId
import net.folivo.trixnity.core.model.events.m.room.CreateEventContent
import net.folivo.trixnity.core.model.events.m.room.JoinRulesEventContent

@Serializable
Expand All @@ -22,6 +23,7 @@ data class GetPublicRoomsResponse(
@SerialName("name") val name: String? = null,
@SerialName("num_joined_members") val joinedMembersCount: Long,
@SerialName("room_id") val roomId: RoomId,
@SerialName("room_type") val roomType: CreateEventContent.RoomType? = null,
@SerialName("topic") val topic: String? = null,
@SerialName("world_readable") val worldReadable: Boolean,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import kotlinx.serialization.Serializable
import net.folivo.trixnity.core.HttpMethod
import net.folivo.trixnity.core.HttpMethodType.POST
import net.folivo.trixnity.core.MatrixEndpoint
import net.folivo.trixnity.core.model.events.m.room.CreateEventContent

/**
* @see <a href="https://spec.matrix.org/v1.3/server-server-api/#post_matrixfederationv1publicrooms">matrix spec</a>
Expand All @@ -24,7 +25,8 @@ object GetPublicRoomsWithFilter : MatrixEndpoint<GetPublicRoomsWithFilter.Reques
) {
@Serializable
data class Filter(
@SerialName("generic_search_term") val genericSearchTerm: String? = null
@SerialName("generic_search_term") val genericSearchTerm: String? = null,
@SerialName("room_types") val roomTypes: Set<CreateEventContent.RoomType?>? = null,
)
}
}

0 comments on commit 98b3dd5

Please sign in to comment.