mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Support sending and accepting room invitations (#7)
This commit is contained in:
parent
b6f4b03c12
commit
54ce042384
8 changed files with 279 additions and 32 deletions
|
@ -31,6 +31,12 @@ impl SpaceState {
|
|||
SpaceState { room_id, room, list }
|
||||
}
|
||||
|
||||
pub fn refresh_room(&mut self, store: &mut ProgramStore) {
|
||||
if let Some(room) = store.application.worker.client.get_room(self.id()) {
|
||||
self.room = room;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn room(&self) -> &MatrixRoom {
|
||||
&self.room
|
||||
}
|
||||
|
@ -88,7 +94,13 @@ impl<'a> StatefulWidget for Space<'a> {
|
|||
type State = SpaceState;
|
||||
|
||||
fn render(self, area: Rect, buffer: &mut Buffer, state: &mut Self::State) {
|
||||
let members = self.store.application.worker.space_members(state.room_id.clone()).unwrap();
|
||||
let members =
|
||||
if let Ok(m) = self.store.application.worker.space_members(state.room_id.clone()) {
|
||||
m
|
||||
} else {
|
||||
return;
|
||||
};
|
||||
|
||||
let items = members
|
||||
.into_iter()
|
||||
.filter_map(|id| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue