Add room visibility endpoints
This commit is contained in:
parent
429e5a5bbe
commit
b064daf23d
@ -12,6 +12,7 @@ Breaking changes:
|
||||
Improvements:
|
||||
|
||||
* Add method `into_event_content` for `r0::room::create_room::CreationContent`
|
||||
* Add room visibility endpoints: `r0::directory::{get_room_visibility, set_room_visibility}`.
|
||||
|
||||
# 0.9.0
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
pub mod get_public_rooms;
|
||||
pub mod get_public_rooms_filtered;
|
||||
pub mod get_room_visibility;
|
||||
pub mod set_room_visibility;
|
||||
|
||||
use js_int::UInt;
|
||||
use ruma_identifiers::{RoomAliasId, RoomId};
|
||||
|
29
src/r0/directory/get_room_visibility.rs
Normal file
29
src/r0/directory/get_room_visibility.rs
Normal file
@ -0,0 +1,29 @@
|
||||
//! [GET /_matrix/client/r0/directory/list/room/{roomId}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-directory-list-room-roomid)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
|
||||
use crate::r0::room::Visibility;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
description: "Get the visibility of a public room on a directory.",
|
||||
name: "get_room_visibility",
|
||||
method: GET,
|
||||
path: "/_matrix/client/r0/directory/list/room/:room_id",
|
||||
rate_limited: false,
|
||||
requires_authentication: false,
|
||||
}
|
||||
|
||||
request {
|
||||
/// The ID of the room of which to request the visibility.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: String,
|
||||
}
|
||||
|
||||
response {
|
||||
/// Visibility of the room.
|
||||
pub visibility: Visibility,
|
||||
}
|
||||
|
||||
error: crate::Error
|
||||
}
|
29
src/r0/directory/set_room_visibility.rs
Normal file
29
src/r0/directory/set_room_visibility.rs
Normal file
@ -0,0 +1,29 @@
|
||||
//! [PUT /_matrix/client/r0/directory/list/room/{roomId}](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-directory-list-room-roomid)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
|
||||
use crate::r0::room::Visibility;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
description: "Set the visibility of a public room on a directory.",
|
||||
name: "set_room_visibility",
|
||||
method: PUT,
|
||||
path: "/_matrix/client/r0/directory/list/room/:room_id",
|
||||
rate_limited: false,
|
||||
requires_authentication: true,
|
||||
}
|
||||
|
||||
request {
|
||||
/// The ID of the room of which to set the visibility.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: String,
|
||||
|
||||
/// New visibility setting for the room.
|
||||
pub visibility: Visibility,
|
||||
}
|
||||
|
||||
response {}
|
||||
|
||||
error: crate::Error
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user