Remove version from Room

We won't need it once we add the per-room lock.
This commit is contained in:
Antonio Scandurra 2022-11-18 20:18:48 +01:00
parent c3d556d9bd
commit 4c1b4953c1
5 changed files with 37 additions and 53 deletions

View file

@ -34,7 +34,6 @@ pub enum Event {
pub struct Room {
id: u64,
version: u64,
live_kit: Option<LiveKitRoom>,
status: RoomStatus,
local_participant: LocalParticipant,
@ -62,7 +61,6 @@ impl Entity for Room {
impl Room {
fn new(
id: u64,
version: u64,
live_kit_connection_info: Option<proto::LiveKitConnectionInfo>,
client: Arc<Client>,
user_store: ModelHandle<UserStore>,
@ -135,7 +133,6 @@ impl Room {
Self {
id,
version,
live_kit: live_kit_room,
status: RoomStatus::Online,
participant_user_ids: Default::default(),
@ -164,7 +161,6 @@ impl Room {
let room = cx.add_model(|cx| {
Self::new(
room_proto.id,
room_proto.version,
response.live_kit_connection_info,
client,
user_store,
@ -209,7 +205,6 @@ impl Room {
let room = cx.add_model(|cx| {
Self::new(
room_id,
0,
response.live_kit_connection_info,
client,
user_store,
@ -321,10 +316,6 @@ impl Room {
futures::join!(remote_participants, pending_participants);
this.update(&mut cx, |this, cx| {
if this.version >= room.version {
return;
}
this.participant_user_ids.clear();
if let Some(participant) = local_participant {
@ -429,7 +420,6 @@ impl Room {
let _ = this.leave(cx);
}
this.version = room.version;
this.check_invariants();
cx.notify();
});