diff --git a/src/r0/membership.rs b/src/r0/membership.rs index 03224f36..86ffb6f7 100644 --- a/src/r0/membership.rs +++ b/src/r0/membership.rs @@ -5,6 +5,7 @@ pub mod forget_room; pub mod invite_user; pub mod join_room_by_id; pub mod join_room_by_id_or_alias; +pub mod joined_rooms; pub mod kick_user; pub mod leave_room; pub mod unban_user; diff --git a/src/r0/membership/joined_rooms.rs b/src/r0/membership/joined_rooms.rs new file mode 100644 index 00000000..93da4aa6 --- /dev/null +++ b/src/r0/membership/joined_rooms.rs @@ -0,0 +1,24 @@ +//! [GET /_matrix/client/r0/joined_rooms](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-joined-rooms) + +use ruma_api_macros::ruma_api; +use ruma_identifiers::RoomId; +use serde_derive::{Deserialize, Serialize}; + +ruma_api! { + metadata { + description: "Get a list of the user's current rooms.", + method: GET, + name: "joined_rooms", + path: "/_matrix/client/r0/joined_rooms", + rate_limited: false, + requires_authentication: true, + } + + request {} + + response { + /// A list of the rooms the user is in, i.e. + /// the ID of each room in which the user has joined membership. + pub joined_rooms: Vec, + } +}