fixed crash condition

asyncversion
Kyle Johnsen 2022-03-07 13:08:19 -05:00
parent 5f42d33040
commit b8f65ecf9d
1 changed files with 10 additions and 4 deletions

View File

@ -804,10 +804,16 @@ fn send_room_message(sender: Rc<RefCell<Client>>, message: &Vec<u8>, rooms: Rc<R
if !include_sender && *_k == sender_ref.id { if !include_sender && *_k == sender_ref.id {
continue; continue;
} }
let mut temp_mut = v.borrow_mut();
temp_mut.message_queue.extend_from_slice(&write_buf); if *_k == sender_ref.id {
temp_mut.notify.notify(); sender_ref.message_queue.extend(&write_buf);
sender_ref.notify.notify();
}else {
let mut temp_mut = v.borrow_mut();
temp_mut.message_queue.extend_from_slice(&write_buf);
temp_mut.notify.notify();
}
} }