Commit 28e7572ed5
Unsigned
Layout: unified · split
src/room/mod.rs +6 −1
| @@ -44,7 +44,7 @@ use std::{ | ||
| 44 | 44 | time::{Instant, SystemTime}, |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | use futures::StreamExt; | |
| 47 | use futures::{executor::block_on, StreamExt}; | |
| 48 | 48 | |
| 49 | 49 | use async_trait::async_trait; |
| 50 | 50 | use unicode_segmentation::UnicodeSegmentation; |
| @@ -200,6 +200,10 @@ impl RoomHandle { | ||
| 200 | 200 | ) -> Self { |
| 201 | 201 | let members = Members::new(room.clone()); |
| 202 | 202 | |
| 203 | let own_nick = block_on(room.get_member(own_user_id)) | |
| 204 | .map(|m| m.name().to_owned()) | |
| 205 | .unwrap_or_else(|| own_user_id.localpart().to_owned()); | |
| 206 | ||
| 203 | 207 | let mut room = MatrixRoom { |
| 204 | 208 | homeserver: Rc::new(homeserver.clone()), |
| 205 | 209 | room_id: Rc::new(room_id.clone()), |
| @@ -270,6 +274,7 @@ impl RoomHandle { | ||
| 270 | 274 | buffer.enable_nicklist(); |
| 271 | 275 | buffer.disable_nicklist_groups(); |
| 272 | 276 | buffer.set_localvar("server", server_name); |
| 277 | buffer.set_localvar("nick", &own_nick); | |
| 273 | 278 | |
| 274 | 279 | // This is fine since we're only given the room to the buffer input and |
| 275 | 280 | // the callback can only run once we yield controll back to Weechat. |