ffi: Add Room::retry_send

This commit is contained in:
Jonas Platte 2023-06-06 17:18:13 +02:00 committed by Jonas Platte
parent df7beb4afd
commit 9505ace8e2
2 changed files with 17 additions and 1 deletions

View File

@ -764,6 +764,22 @@ impl Room {
self.send_attachment(url, mime_type, attachment_config)
}
pub fn retry_send(&self, txn_id: String) {
let timeline = match &*self.timeline.read().unwrap() {
Some(t) => Arc::clone(t),
None => {
error!("Timeline not set up, can't retry sending message");
return;
}
};
RUNTIME.spawn(async move {
if let Err(e) = timeline.retry_send(txn_id.as_str().into()).await {
error!(txn_id, "Failed to retry sending: {e}");
}
});
}
}
impl Room {

View File

@ -331,7 +331,7 @@ impl<P: RoomDataProvider> TimelineInner<P> {
let local_item = item.as_local()?;
if !matches!(&local_item.send_state, EventSendState::SendingFailed { .. }) {
debug!("Attempted to retry sending of an item that is not in failed state");
debug!("Attempted to retry the sending of an item that is not in failed state");
return None;
}