mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-04 22:15:44 -04:00
timeline queue refactoring: address review comments
This commit is contained in:
@@ -723,7 +723,11 @@ impl<P: RoomDataProvider> TimelineInner<P> {
|
||||
// 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 {
|
||||
|
||||
@@ -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 { .. } => {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user