Commit 7ebf31f8fb
Unsigned
Layout: unified · split
src/room/members.rs +14 −14
| @@ -37,6 +37,20 @@ pub struct Members { | ||
| 37 | 37 | pub(super) buffer: Rc<Option<BufferHandle>>, |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | enum RoomError { | |
| 41 | NonExistentMember(UserId), | |
| 42 | } | |
| 43 | ||
| 44 | #[derive(Clone, Debug)] | |
| 45 | pub struct WeechatRoomMember { | |
| 46 | pub user_id: Rc<UserId>, | |
| 47 | pub nick: Rc<RefCell<String>>, | |
| 48 | pub display_name: Rc<RefCell<Option<String>>>, | |
| 49 | pub prefix: Rc<RefCell<Option<String>>>, | |
| 50 | #[allow(clippy::rc_buffer)] | |
| 51 | pub color: Rc<String>, | |
| 52 | } | |
| 53 | ||
| 40 | 54 | impl Members { |
| 41 | 55 | pub fn new(room: Arc<RwLock<Room>>) -> Self { |
| 42 | 56 | Self { |
| @@ -427,20 +441,6 @@ impl Members { | ||
| 427 | 441 | } |
| 428 | 442 | } |
| 429 | 443 | |
| 430 | enum RoomError { | |
| 431 | NonExistentMember(UserId), | |
| 432 | } | |
| 433 | ||
| 434 | #[derive(Clone, Debug)] | |
| 435 | pub struct WeechatRoomMember { | |
| 436 | pub user_id: Rc<UserId>, | |
| 437 | pub nick: Rc<RefCell<String>>, | |
| 438 | pub display_name: Rc<RefCell<Option<String>>>, | |
| 439 | pub prefix: Rc<RefCell<Option<String>>>, | |
| 440 | #[allow(clippy::rc_buffer)] | |
| 441 | pub color: Rc<String>, | |
| 442 | } | |
| 443 | ||
| 444 | 444 | impl WeechatRoomMember { |
| 445 | 445 | pub fn new( |
| 446 | 446 | user_id: &UserId, |
src/room/mod.rs +1 −1
| @@ -535,7 +535,7 @@ impl RoomHandle { | ||
| 535 | 535 | room, |
| 536 | 536 | own_user_id: Rc::new(own_user_id.to_owned()), |
| 537 | 537 | members: members.clone(), |
| 538 | buffer: members.buffer.clone(), | |
| 538 | buffer: members.buffer, | |
| 539 | 539 | outgoing_messages: MessageQueue::new(), |
| 540 | 540 | }; |
| 541 | 541 | |