async_client: Add a method to fetch the homeserver.

master
Damir Jelić 2020-01-11 22:24:32 +01:00
parent 67221ecb54
commit 19383fd28c
1 changed files with 6 additions and 0 deletions

View File

@ -160,10 +160,16 @@ impl AsyncClient {
})
}
/// Is the client logged in.
pub fn logged_in(&self) -> bool {
self.base_client.read().unwrap().logged_in()
}
/// The Homeserver of the client.
pub fn homeserver(&self) -> &Url {
&self.homeserver
}
pub fn add_event_callback<C: 'static>(
&mut self,
mut callback: impl FnMut(Arc<RwLock<Room>>, Arc<EventResult<RoomEvent>>) -> C + 'static + Send,