mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat: Fall back to remote room summary if local fails
This commit is contained in:
@@ -7,7 +7,7 @@ use conduwuit::{
|
|||||||
};
|
};
|
||||||
use futures::{
|
use futures::{
|
||||||
FutureExt, StreamExt, TryFutureExt,
|
FutureExt, StreamExt, TryFutureExt,
|
||||||
future::{OptionFuture, join, join3},
|
future::{OptionFuture, join, join3, ok},
|
||||||
stream::FuturesUnordered,
|
stream::FuturesUnordered,
|
||||||
};
|
};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
@@ -80,9 +80,15 @@ async fn room_summary_response(
|
|||||||
.server_in_room(services.globals.server_name(), room_id)
|
.server_in_room(services.globals.server_name(), room_id)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
return local_room_summary_response(services, room_id, sender_user)
|
match local_room_summary_response(services, room_id, sender_user)
|
||||||
.boxed()
|
.boxed()
|
||||||
.await;
|
.await
|
||||||
|
{
|
||||||
|
| Ok(response) => return Ok(response),
|
||||||
|
| Err(e) => {
|
||||||
|
debug_warn!("Failed to get local room summary: {e:?}, falling back to remote");
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let room =
|
let room =
|
||||||
|
|||||||
Reference in New Issue
Block a user