ffi: Add Room::retry_send
This commit is contained in:
parent
df7beb4afd
commit
9505ace8e2
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue