mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-27 11:42:46 +00:00
refactor: appease clippy
This commit is contained in:
parent
d841b81c56
commit
4c06f329c4
@ -1618,7 +1618,7 @@ pub async fn sync_events_v4_route(
|
|||||||
.rooms
|
.rooms
|
||||||
.state_accessor
|
.state_accessor
|
||||||
.get_name(room_id)?
|
.get_name(room_id)?
|
||||||
.or_else(|| name),
|
.or(name),
|
||||||
avatar: if let Some(avatar) = avatar {
|
avatar: if let Some(avatar) = avatar {
|
||||||
ruma::JsOption::Some(avatar)
|
ruma::JsOption::Some(avatar)
|
||||||
} else {
|
} else {
|
||||||
|
@ -966,14 +966,21 @@ impl Service {
|
|||||||
|
|
||||||
debug!("Resolving state");
|
debug!("Resolving state");
|
||||||
|
|
||||||
let lock = services().globals.stateres_mutex.lock();
|
let fetch_event = |id: &_| {
|
||||||
let state = match state_res::resolve(room_version_id, &fork_states, auth_chain_sets, |id| {
|
|
||||||
let res = services().rooms.timeline.get_pdu(id);
|
let res = services().rooms.timeline.get_pdu(id);
|
||||||
if let Err(e) = &res {
|
if let Err(e) = &res {
|
||||||
error!("LOOK AT ME Failed to fetch event: {}", e);
|
error!("LOOK AT ME Failed to fetch event: {}", e);
|
||||||
}
|
}
|
||||||
res.ok().flatten()
|
res.ok().flatten()
|
||||||
}) {
|
};
|
||||||
|
|
||||||
|
let lock = services().globals.stateres_mutex.lock();
|
||||||
|
let state = match state_res::resolve(
|
||||||
|
room_version_id,
|
||||||
|
&fork_states,
|
||||||
|
auth_chain_sets,
|
||||||
|
fetch_event,
|
||||||
|
) {
|
||||||
Ok(new_state) => new_state,
|
Ok(new_state) => new_state,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
return Err(Error::bad_database("State resolution failed, either an event could not be found or deserialization"));
|
return Err(Error::bad_database("State resolution failed, either an event could not be found or deserialization"));
|
||||||
|
@ -133,8 +133,7 @@ impl Service {
|
|||||||
.ok_or_else(|| Error::bad_database("Event in space state not found"))?;
|
.ok_or_else(|| Error::bad_database("Event in space state not found"))?;
|
||||||
|
|
||||||
if serde_json::from_str::<SpaceChildEventContent>(pdu.content.get())
|
if serde_json::from_str::<SpaceChildEventContent>(pdu.content.get())
|
||||||
.ok()
|
.ok().map(|c| c.via)
|
||||||
.and_then(|c| Some(c.via))
|
|
||||||
.map_or(true, |v| v.is_empty())
|
.map_or(true, |v| v.is_empty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user