Refactor send and sync modules

This commit moves the message, member and state event endpoints from the
send and sync modules to make interaction with those events more
consistent with how other events are used, for example,
`r0::<event type>::<create, get, update, delete>_event`.
This commit is contained in:
iinuwa 2019-12-26 09:44:45 -05:00 committed by Jonas Platte
parent f434c70e87
commit 301d38c104
15 changed files with 28 additions and 15 deletions

View File

@ -10,12 +10,22 @@ Breaking changes:
* Move `r0::room::create_room::Visibility` to `r0::room::Visibility`
* Move `r0::account::register::AuthenticationData` to `r0::account::AuthenticationData`
* Remove presence list endpoints `r0::presence::{get_subscribed_presences, update_presence_subscriptions}` (removed in 0.5.0)
* Refactor `r0::send` endpoints and remove module:
* Move `r0::send::send_message_event` to `r0::message::create_message_event`
* Move `r0::send::send_state_event_for_empty_key` to `r0::state:create_state_event_for_empty_key`
* Move `r0::send::send_state_event_for_key` to `r0::state:create_state_event_for_key`
* Refactor `r0::sync` endpoints:
* Move `r0::sync::get_member_events` to `r0::membership::get_member_events`
* Move `r0::sync::get_message_events` to `r0::message::get_message_events`
* Move `r0::sync::get_state_events` to `r0::state::get_state_events`
* Move `r0::sync::get_state_events_for_empty_key` to `r0::state::get_state_events_for_empty_key`
* Move `r0::sync::get_state_events_for_key` to `r0::state::get_state_events_for_key`
Improvements:
* Update `r0::directory::get_public_rooms` from r0.3.0 to r0.6.0
* Add `r0::directory::get_public_rooms_filtered` (introduced upstream in r0.3.0)
* Add `filter` optional parameter to `r0::sync::get_message_events` (introduced upstream in r0.3.0)
* Add `filter` optional parameter to `r0::message::get_message_events` (introduced upstream in r0.3.0)
* Add `r0::appservice::set_room_visibility` (part of application service extensions for the client-server API)
* Add `contains_url` to `r0::filter::RoomEventFilter` (introduced upstream in r0.3.0)
* Update `r0::account::change_password` from r0.3.0 to r0.6.0

View File

@ -11,6 +11,7 @@ pub mod directory;
pub mod filter;
pub mod media;
pub mod membership;
pub mod message;
pub mod presence;
pub mod profile;
pub mod push;
@ -18,9 +19,9 @@ pub mod receipt;
pub mod redact;
pub mod room;
pub mod search;
pub mod send;
pub mod server;
pub mod session;
pub mod state;
pub mod sync;
pub mod tag;
pub mod thirdparty;

View File

@ -2,6 +2,7 @@
pub mod ban_user;
pub mod forget_room;
pub mod get_member_events;
pub mod invite_user;
pub mod join_room_by_id;
pub mod join_room_by_id_or_alias;

4
src/r0/message.rs Normal file
View File

@ -0,0 +1,4 @@
//! Enpoints for sending and receiving messages
pub mod create_message_event;
pub mod get_message_events;

View File

@ -8,7 +8,7 @@ ruma_api! {
metadata {
description: "Send a message event to a room.",
method: PUT,
name: "send_message_event",
name: "create_message_event",
path: "/_matrix/client/r0/rooms/:room_id/send/:event_type/:txn_id",
rate_limited: false,
requires_authentication: true,

View File

@ -1,5 +0,0 @@
//! Endpoints for sending events.
pub mod send_message_event;
pub mod send_state_event_for_empty_key;
pub mod send_state_event_for_key;

7
src/r0/state.rs Normal file
View File

@ -0,0 +1,7 @@
//! Endpoints for managing room state
pub mod create_state_event_for_empty_key;
pub mod create_state_event_for_key;
pub mod get_state_events;
pub mod get_state_events_for_empty_key;
pub mod get_state_events_for_key;

View File

@ -9,7 +9,7 @@ ruma_api! {
metadata {
description: "Send a state event to a room associated with the empty state key.",
method: PUT,
name: "send_state_event_for_empty_key",
name: "create_state_event_for_empty_key",
path: "/_matrix/client/r0/rooms/:room_id/state/:event_type",
rate_limited: false,
requires_authentication: true,

View File

@ -9,7 +9,7 @@ ruma_api! {
metadata {
description: "Send a state event to a room associated with a given state key.",
method: PUT,
name: "send_state_event_for_key",
name: "create_state_event_for_key",
path: "/_matrix/client/r0/rooms/:room_id/state/:event_type/:state_key",
rate_limited: false,
requires_authentication: true,

View File

@ -1,8 +1,3 @@
//! Endpoints for getting and synchronizing events.
pub mod get_member_events;
pub mod get_message_events;
pub mod get_state_events;
pub mod get_state_events_for_empty_key;
pub mod get_state_events_for_key;
pub mod sync_events;