Skip to content

Commit 95edb89

Browse files
committed
widget-driver: rename all mentions of future in the context of future events.
We need to disambigute future events and rust futures.
1 parent b2caec3 commit 95edb89

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

crates/matrix-sdk/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Additions:
3535
- Add `send_call_notification` and `send_call_notification_if_needed` methods. This allows to implement sending ring events on call start.
3636
- The `get_media_content`, `get_media_file` and `get_file` methods of the
3737
`Media` api now support the new authenticated media endpoints.
38-
- WidgetDriver: Allow the `"future_timeout"` and `"future_group_id"` fields in the `send_event` widget actions.
39-
As defined in [MSC4157](https://github.com/matrix-org/matrix-spec-proposals/pull/4157)
38+
- WidgetDriver: Support the `"future_timeout"` and `"future_group_id"` fields in the `send_event` widget actions.
39+
This allows to send future events, as defined in [MSC4157](https://github.com/matrix-org/matrix-spec-proposals/pull/4157)
4040

4141
# 0.7.0
4242

crates/matrix-sdk/src/widget/machine/from_widget.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub(crate) struct SendEventResponse {
140140
/// The event id of the send event. It's optional because if it's a future
141141
/// event, it does not get the event_id at this point.
142142
pub(crate) event_id: Option<OwnedEventId>,
143-
/// A token to send/insert the future into the DAG.
143+
/// A token to send/insert the future event into the DAG.
144144
pub(crate) send_token: Option<String>,
145145
/// A token to cancel this future event. It will never be seny if this is
146146
/// called.
@@ -149,11 +149,11 @@ pub(crate) struct SendEventResponse {
149149
/// multiple future events. Only one of the connected future event will be
150150
/// sent and inserted into the DAG.
151151
pub(crate) future_group_id: Option<String>,
152-
/// A token used to refresh the timer of the future. This allows
152+
/// A token used to refresh the timer of the future event. This allows
153153
/// to implement heartbeat-like capabilities. An event is only sent once
154154
/// a refresh in the timeout interval is missed.
155155
///
156-
/// If the future does not have a timeout this will be `None`.
156+
/// If the future event does not have a timeout this will be `None`.
157157
pub(crate) refresh_token: Option<String>,
158158
}
159159

crates/matrix-sdk/src/widget/machine/tests/send_event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::widget::machine::{
1010
};
1111

1212
#[test]
13-
fn parse_future_action() {
13+
fn parse_future_event_widget_action() {
1414
let raw = json_string!({
1515
"api": "fromWidget",
1616
"widgetId": WIDGET_ID,

crates/matrix-sdk/src/widget/matrix.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,32 +113,32 @@ impl MatrixDriver {
113113
event_type: TimelineEventType,
114114
state_key: Option<String>,
115115
content: Box<RawJsonValue>,
116-
future: Option<future::FutureParameters>,
116+
future_parameters: Option<future::FutureParameters>,
117117
) -> Result<SendEventResponse> {
118118
let type_str = event_type.to_string();
119-
Ok(match (state_key, future) {
119+
Ok(match (state_key, future_parameters) {
120120
(None, None) => SendEventResponse::from_event_id(
121121
self.room.send_raw(&type_str, content).await?.event_id,
122122
),
123123
(Some(key), None) => SendEventResponse::from_event_id(
124124
self.room.send_state_event_raw(&type_str, &key, content).await?.event_id,
125125
),
126-
(None, Some(future)) => {
126+
(None, Some(future_parameters)) => {
127127
let r = future::send_future_message_event::unstable::Request::new_raw(
128128
self.room.room_id().to_owned(),
129129
TransactionId::new().to_owned(),
130130
MessageLikeEventType::from(type_str),
131-
future,
131+
future_parameters,
132132
Raw::<AnyMessageLikeEventContent>::from_json(content),
133133
);
134134
self.room.client.send(r, None).await.map(|r| r.into())?
135135
}
136-
(Some(key), Some(future)) => {
136+
(Some(key), Some(future_parameters)) => {
137137
let r = future::send_future_state_event::unstable::Request::new_raw(
138138
self.room.room_id().to_owned(),
139139
key,
140140
StateEventType::from(type_str),
141-
future,
141+
future_parameters,
142142
Raw::<AnyStateEventContent>::from_json(content),
143143
);
144144
self.room.client.send(r, None).await.map(|r| r.into())?

crates/matrix-sdk/tests/integration/widget.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ async fn send_room_name() {
601601
}
602602

603603
#[async_test]
604-
async fn send_future_room_message() {
604+
async fn send_future_room_message_event() {
605605
let (_, mock_server, driver_handle) = run_test_driver(false).await;
606606

607607
negotiate_capabilities(&driver_handle, json!(["org.matrix.msc2762.send.event:m.room.message"]))
@@ -654,7 +654,7 @@ async fn send_future_room_message() {
654654
}
655655

656656
#[async_test]
657-
async fn send_future_state() {
657+
async fn send_future_state_event() {
658658
let (_, mock_server, driver_handle) = run_test_driver(false).await;
659659

660660
negotiate_capabilities(

0 commit comments

Comments
 (0)