fix: filter public room dir

next
Timo Kösters 2020-09-14 16:23:15 +02:00
parent d1099e9224
commit 9f05ef926a
No known key found for this signature in database
GPG Key ID: 24DA7517711A2BA4
1 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,7 @@ use ruma::{
}, },
federation, federation,
}, },
directory::Filter,
directory::RoomNetwork, directory::RoomNetwork,
directory::{IncomingFilter, IncomingRoomNetwork, PublicRoomsChunk}, directory::{IncomingFilter, IncomingRoomNetwork, PublicRoomsChunk},
events::{ events::{
@ -112,7 +113,7 @@ pub async fn get_public_rooms_filtered_helper(
server: Option<&ServerName>, server: Option<&ServerName>,
limit: Option<js_int::UInt>, limit: Option<js_int::UInt>,
since: Option<&str>, since: Option<&str>,
_filter: &IncomingFilter, filter: &IncomingFilter,
_network: &IncomingRoomNetwork, _network: &IncomingRoomNetwork,
) -> ConduitResult<get_public_rooms_filtered::Response> { ) -> ConduitResult<get_public_rooms_filtered::Response> {
if let Some(other_server) = server if let Some(other_server) = server
@ -122,9 +123,12 @@ pub async fn get_public_rooms_filtered_helper(
let response = server_server::send_request( let response = server_server::send_request(
&db, &db,
other_server, other_server,
federation::directory::get_public_rooms::v1::Request { federation::directory::get_public_rooms_filtered::v1::Request {
limit, limit,
since: since.as_deref(), since: since.as_deref(),
filter: Filter {
generic_search_term: filter.generic_search_term.as_deref(),
},
room_network: RoomNetwork::Matrix, room_network: RoomNetwork::Matrix,
}, },
) )