state_store: append user name to path when `store_room_state` is called

master
Devin R 2020-04-27 16:55:40 -04:00
parent c91263eb13
commit 631ad261ae
2 changed files with 2 additions and 7 deletions

View File

@ -209,12 +209,6 @@ impl Client {
*olm = Some(OlmMachine::new(&response.user_id, &response.device_id)?); *olm = Some(OlmMachine::new(&response.user_id, &response.device_id)?);
} }
if let Some(store) = self.state_store.as_ref() {
store
.store_client_state(ClientState::from_base_client(self))
.await?;
}
Ok(()) Ok(())
} }

View File

@ -110,7 +110,8 @@ impl StateStore for JsonStore {
async fn store_room_state(&self, room: &Room) -> Result<()> { async fn store_room_state(&self, room: &Room) -> Result<()> {
if !self.user_path_set.load(Ordering::SeqCst) { if !self.user_path_set.load(Ordering::SeqCst) {
// TODO Error here, should the load methods also error? self.user_path_set.swap(true, Ordering::SeqCst);
self.path.write().await.push(room.own_user_id.localpart())
} }
let mut path = self.path.read().await.clone(); let mut path = self.path.read().await.clone();