2020-07-30 16:14:47 +00:00
|
|
|
use crate::{utils, ConduitResult};
|
|
|
|
use ruma::api::client::r0::filter::{self, create_filter, get_filter};
|
|
|
|
|
|
|
|
#[cfg(feature = "conduit_bin")]
|
|
|
|
use rocket::{get, post};
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "conduit_bin", get("/_matrix/client/r0/user/<_>/filter/<_>"))]
|
2021-02-28 11:41:03 +00:00
|
|
|
#[tracing::instrument]
|
2020-10-21 19:28:02 +00:00
|
|
|
pub async fn get_filter_route() -> ConduitResult<get_filter::Response> {
|
2020-07-30 16:14:47 +00:00
|
|
|
// TODO
|
2020-09-08 15:32:03 +00:00
|
|
|
Ok(get_filter::Response::new(filter::IncomingFilterDefinition {
|
2020-08-06 12:29:59 +00:00
|
|
|
event_fields: None,
|
2020-10-27 23:10:09 +00:00
|
|
|
event_format: filter::EventFormat::default(),
|
|
|
|
account_data: filter::IncomingFilter::default(),
|
|
|
|
room: filter::IncomingRoomFilter::default(),
|
|
|
|
presence: filter::IncomingFilter::default(),
|
2020-08-06 12:29:59 +00:00
|
|
|
})
|
2020-07-30 16:14:47 +00:00
|
|
|
.into())
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "conduit_bin", post("/_matrix/client/r0/user/<_>/filter"))]
|
2021-02-28 11:41:03 +00:00
|
|
|
#[tracing::instrument]
|
2020-10-21 19:28:02 +00:00
|
|
|
pub async fn create_filter_route() -> ConduitResult<create_filter::Response> {
|
2020-07-30 16:14:47 +00:00
|
|
|
// TODO
|
2020-08-06 12:29:59 +00:00
|
|
|
Ok(create_filter::Response::new(utils::random_string(10)).into())
|
2020-07-30 16:14:47 +00:00
|
|
|
}
|