Remove stuff only needed for server-side usage

This commit is contained in:
Jonas Platte 2019-10-17 00:41:18 +02:00
parent 4ad8ee7d08
commit 134738f676
3 changed files with 16 additions and 16 deletions

View File

@ -85,7 +85,7 @@ pub struct EventContext {
} }
/// Context for search results, if requested. /// Context for search results, if requested.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct EventContextResult { pub struct EventContextResult {
/// Pagination token for the end of the chunk. /// Pagination token for the end of the chunk.
pub end: String, pub end: String,
@ -155,7 +155,7 @@ pub enum OrderBy {
} }
/// Categories of events that can be searched for. /// Categories of events that can be searched for.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct ResultCategories { pub struct ResultCategories {
/// Room event results. /// Room event results.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@ -163,7 +163,7 @@ pub struct ResultCategories {
} }
/// Categories of events that can be searched for. /// Categories of events that can be searched for.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct RoomEventResults { pub struct RoomEventResults {
/// An approximate count of the total number of results found. /// An approximate count of the total number of results found.
pub count: UInt, pub count: UInt,
@ -198,7 +198,7 @@ pub struct ResultGroup {
} }
/// A search result. /// A search result.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct SearchResult { pub struct SearchResult {
/// Context for result, if requested. /// Context for result, if requested.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]

View File

@ -1,7 +1,7 @@
//! [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid) //! [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
use ruma_api::ruma_api; use ruma_api::ruma_api;
use ruma_events::{room::message::MessageEventContent, EventResult, EventType}; use ruma_events::{room::message::MessageEventContent, EventType};
use ruma_identifiers::{EventId, RoomId}; use ruma_identifiers::{EventId, RoomId};
ruma_api! { ruma_api! {
@ -30,7 +30,7 @@ ruma_api! {
pub txn_id: String, pub txn_id: String,
/// The event's content. /// The event's content.
#[ruma_api(body)] #[ruma_api(body)]
pub data: EventResult<MessageEventContent>, // FIXME pub data: MessageEventContent,
} }
response { response {

View File

@ -114,7 +114,7 @@ mod filter_def_serde {
} }
/// Updates to rooms. /// Updates to rooms.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct Rooms { pub struct Rooms {
/// The rooms that the user has left or been banned from. /// The rooms that the user has left or been banned from.
pub leave: HashMap<RoomId, LeftRoom>, pub leave: HashMap<RoomId, LeftRoom>,
@ -125,7 +125,7 @@ pub struct Rooms {
} }
/// Historical updates to left rooms. /// Historical updates to left rooms.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct LeftRoom { pub struct LeftRoom {
/// The timeline of messages and state changes in the room up to the point when the user /// The timeline of messages and state changes in the room up to the point when the user
/// left. /// left.
@ -135,7 +135,7 @@ pub struct LeftRoom {
} }
/// Updates to joined rooms. /// Updates to joined rooms.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct JoinedRoom { pub struct JoinedRoom {
/// Counts of unread notifications for this room. /// Counts of unread notifications for this room.
pub unread_notifications: UnreadNotificationsCount, pub unread_notifications: UnreadNotificationsCount,
@ -164,7 +164,7 @@ pub struct UnreadNotificationsCount {
} }
/// Events in the room. /// Events in the room.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct Timeline { pub struct Timeline {
/// True if the number of events returned was limited by the `limit` on the filter. /// True if the number of events returned was limited by the `limit` on the filter.
pub limited: bool, pub limited: bool,
@ -176,42 +176,42 @@ pub struct Timeline {
} }
/// State events in the room. /// State events in the room.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct State { pub struct State {
/// A list of state events. /// A list of state events.
pub events: Vec<EventResult<only::StateEvent>>, pub events: Vec<EventResult<only::StateEvent>>,
} }
/// The private data that this user has attached to this room. /// The private data that this user has attached to this room.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct AccountData { pub struct AccountData {
/// A list of events. /// A list of events.
pub events: Vec<EventResult<only::Event>>, pub events: Vec<EventResult<only::Event>>,
} }
/// Ephemeral events not recorded in the timeline or state of the room. /// Ephemeral events not recorded in the timeline or state of the room.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct Ephemeral { pub struct Ephemeral {
/// A list of events. /// A list of events.
pub events: Vec<EventResult<only::Event>>, pub events: Vec<EventResult<only::Event>>,
} }
/// Updates to the rooms that the user has been invited to. /// Updates to the rooms that the user has been invited to.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct InvitedRoom { pub struct InvitedRoom {
/// The state of a room that the user has been invited to. /// The state of a room that the user has been invited to.
pub invite_state: InviteState, pub invite_state: InviteState,
} }
/// The state of a room that the user has been invited to. /// The state of a room that the user has been invited to.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct InviteState { pub struct InviteState {
/// A list of state events. /// A list of state events.
pub events: Vec<EventResult<stripped::StrippedState>>, pub events: Vec<EventResult<stripped::StrippedState>>,
} }
/// Updates to the presence status of other users. /// Updates to the presence status of other users.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize)]
pub struct Presence { pub struct Presence {
/// A list of events. /// A list of events.
pub events: Vec<EventResult<only::Event>>, pub events: Vec<EventResult<only::Event>>,