Use Ruleset type from ruma_events in get_pushrules endpoints

This commit is contained in:
Jonas Platte 2020-05-31 23:18:22 +02:00
parent 80726d0546
commit da4abacf69
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
3 changed files with 6 additions and 10 deletions

View File

@ -8,6 +8,8 @@ Breaking changes:
* Update `r0::room::create_room::CreationContent`
* Change `federated`s type from `Option<bool>` to `bool`
* Add `predecessor` field
* Update `r0::push::get_pushrules_all` and `r0::push::get_pushrules_global_scope` to use the
`Ruleset` type from `ruma_events`
Improvements:

View File

@ -1,10 +1,7 @@
//! [GET /_matrix/client/r0/pushrules/](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-pushrules)
use std::collections::BTreeMap;
use ruma_api::ruma_api;
use super::{PushRule, RuleKind};
use ruma_events::push_rules::Ruleset;
ruma_api! {
metadata {
@ -20,7 +17,7 @@ ruma_api! {
response {
/// The global ruleset
pub global: BTreeMap<RuleKind, Vec<PushRule>>
pub global: Ruleset,
}
error: crate::Error

View File

@ -1,10 +1,7 @@
//! [GET /_matrix/client/r0/pushrules/global/](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-pushrules)
use std::collections::BTreeMap;
use ruma_api::ruma_api;
use super::{PushRule, RuleKind};
use ruma_events::push_rules::Ruleset;
ruma_api! {
metadata {
@ -21,7 +18,7 @@ ruma_api! {
response {
/// The global ruleset.
#[ruma_api(body)]
pub global: BTreeMap<RuleKind, Vec<PushRule>>,
pub global: Ruleset,
}
error: crate::Error