diff --git a/crates/matrix-sdk-ui/src/timeline/inner/mod.rs b/crates/matrix-sdk-ui/src/timeline/inner/mod.rs index 56031535d..4323ad159 100644 --- a/crates/matrix-sdk-ui/src/timeline/inner/mod.rs +++ b/crates/matrix-sdk-ui/src/timeline/inner/mod.rs @@ -723,7 +723,11 @@ impl TimelineInner

{ // reflected in the timeline, so we set all other pending events to // cancelled. // - // TODO(bnjbvr): spooky action at a distance here^ + // TODO(bnjbvr): spooky action at a distance here^. The sending task is the one + // deciding to clear the sending queue, so we're updating based on that implicit + // knowledge here. Instead, the sending queue should notify the timeline that + // it's deciding to not send those messages, and then only the + // timeline should mark these items as cancelled. let items = &mut txn.items; let num_items = items.len(); for idx in 0..num_items { diff --git a/crates/matrix-sdk-ui/src/timeline/mod.rs b/crates/matrix-sdk-ui/src/timeline/mod.rs index 109010960..5c6e147ea 100644 --- a/crates/matrix-sdk-ui/src/timeline/mod.rs +++ b/crates/matrix-sdk-ui/src/timeline/mod.rs @@ -586,7 +586,7 @@ impl Timeline { | TimelineItemContent::ProfileChange(_) | TimelineItemContent::OtherState(_) | TimelineItemContent::CallInvite => { - error_return!("Retrying state events/call invite is not currently supported"); + error_return!("Retrying state events/call invites is not currently supported"); } TimelineItemContent::FailedToParseMessageLike { .. } | TimelineItemContent::FailedToParseState { .. } => { diff --git a/crates/matrix-sdk-ui/src/timeline/queue.rs b/crates/matrix-sdk-ui/src/timeline/queue.rs index 6e8d6ebdb..b99836aa2 100644 --- a/crates/matrix-sdk-ui/src/timeline/queue.rs +++ b/crates/matrix-sdk-ui/src/timeline/queue.rs @@ -115,7 +115,9 @@ async fn send_or_queue_msg( return; } - if room.state() != RoomState::Joined { + if room.state() == RoomState::Joined { + send_task.start(room, msg); + } else { info!("Refusing to send message, room is not joined"); timeline .update_event_send_state( @@ -126,10 +128,7 @@ async fn send_or_queue_msg( }, ) .await; - return; } - - send_task.start(room, msg); } async fn handle_send_result(