matrix_sdk_crypto/types/requests/room_message.rs
1// Copyright 2020 The Matrix.org Foundation C.I.C.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use ruma::{events::AnyMessageLikeEventContent, OwnedRoomId, OwnedTransactionId};
16
17/// Customized owned request type for sending out room messages.
18#[derive(Clone, Debug)]
19pub struct RoomMessageRequest {
20 /// The room to send the event to.
21 pub room_id: OwnedRoomId,
22
23 /// The transaction ID for this event.
24 ///
25 /// Clients should generate an ID unique across requests with the
26 /// same access token; it will be used by the server to ensure
27 /// idempotency of requests.
28 pub txn_id: OwnedTransactionId,
29
30 /// The event content to send.
31 pub content: Box<AnyMessageLikeEventContent>,
32}