rustfmt
This commit is contained in:
parent
5f38edcb3b
commit
fab114459b
|
@ -575,7 +575,12 @@ impl RoomBuffer {
|
|||
let initial_roominfo_hash = hash_roominfo(room.clone_info());
|
||||
let computed_roominfo = compute_room_info(room, initial_roominfo_hash).await;
|
||||
|
||||
tokio::task::spawn(update_roominfo_worker(room_id.clone(), initial_roominfo_hash, roominfo_rx, computed_roominfo_tx));
|
||||
tokio::task::spawn(update_roominfo_worker(
|
||||
room_id.clone(),
|
||||
initial_roominfo_hash,
|
||||
roominfo_rx,
|
||||
computed_roominfo_tx,
|
||||
));
|
||||
|
||||
let mut self_ = RoomBuffer {
|
||||
config,
|
||||
|
@ -652,7 +657,8 @@ impl Buffer for RoomBuffer {
|
|||
fn short_name(&self) -> String {
|
||||
self
|
||||
.computed_roominfo
|
||||
.display_name.as_ref()
|
||||
.display_name
|
||||
.as_ref()
|
||||
.map(|dn| dn.to_string())
|
||||
.unwrap_or_else(|| {
|
||||
self
|
||||
|
@ -675,13 +681,15 @@ impl Buffer for RoomBuffer {
|
|||
fn parent(&self) -> Option<BufferId> {
|
||||
self
|
||||
.computed_roominfo
|
||||
.parent.as_ref()
|
||||
.parent
|
||||
.as_ref()
|
||||
.map(|parent| BufferId::Room(parent.clone()))
|
||||
}
|
||||
fn children(&self) -> Option<SortedVec<(BufferSortKey, BufferId)>> {
|
||||
self
|
||||
.computed_roominfo
|
||||
.children.as_ref()
|
||||
.children
|
||||
.as_ref()
|
||||
.map(|children: &SortedVec<_>| {
|
||||
let children = children
|
||||
.iter()
|
||||
|
@ -773,10 +781,7 @@ impl Buffer for RoomBuffer {
|
|||
}
|
||||
|
||||
fn fully_read(&self) -> FullyReadStatus {
|
||||
match self
|
||||
.computed_roominfo
|
||||
.fully_read_at.as_ref()
|
||||
{
|
||||
match self.computed_roominfo.fully_read_at.as_ref() {
|
||||
None => FullyReadStatus::All, // Unknown, assume it's read for now, we'll probably find out later
|
||||
Some(fully_read_at) => {
|
||||
// Iterate through all buffers, and if any buffer's last event is not the one where
|
||||
|
@ -1015,10 +1020,9 @@ async fn update_roominfo_worker(
|
|||
}
|
||||
last_roominfo_hash = roominfo_hash;
|
||||
tracing::trace!("visible change to {}", room_id);
|
||||
let room = buf
|
||||
.client
|
||||
.get_room(&room_id)
|
||||
.expect("client missing room");
|
||||
computed_roominfo_tx.send(compute_room_info(room, roominfo_hash).await).expect("failed to send to computed_roominfo_tx");
|
||||
let room = buf.client.get_room(&room_id).expect("client missing room");
|
||||
computed_roominfo_tx
|
||||
.send(compute_room_info(room, roominfo_hash).await)
|
||||
.expect("failed to send to computed_roominfo_tx");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue