From 7466f90f3b50505431ec63e775b70dbac98f151d Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 17 Sep 2020 23:54:13 +0200 Subject: rust: Update to latest tomsg-rs --- rust/src/main.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'rust/src') diff --git a/rust/src/main.rs b/rust/src/main.rs index 5cf9666..8dc5163 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -206,7 +206,7 @@ impl App { let room2 = room.clone(); task::spawn(async move { if let Ok(Reply::List(members)) = - send_command(&app.conn, Command::ListMembers { room_name: room2.clone() }) + send_command(&app.conn, Command::ListMembers { roomname: room2.clone() }) .await { app.put_members(&room2, members).await.unwrap(); } @@ -215,7 +215,7 @@ impl App { let room2 = room.clone(); task::spawn(async move { if let Ok(Reply::History(hist)) = - send_command(&app.conn, Command::History { room_name: room2.clone(), count: 20 }) + send_command(&app.conn, Command::History { roomname: room2.clone(), count: 20 }) .await { app.put_history(&room2, hist).await.unwrap(); } @@ -296,22 +296,21 @@ impl App { state.append_history(&roomname, HItem::Message(msgid))?; Ok(()) - } async fn on_push(self: &Arc, pm: PushMessage) { match pm { - PushMessage::Invite { room_name: room, inviter: _ } => { + PushMessage::Invite { roomname: room, inviter: _ } => { self.enter_room(&room).await.unwrap(); } - PushMessage::Join { room_name: room, user } => { - self.add_member(&room, user.clone()).await.unwrap(); - self.append_history_item(&room, HItem::Service(format!("Join: <{}>", user))).await.unwrap(); + PushMessage::Join { roomname: room, username } => { + self.add_member(&room, username.clone()).await.unwrap(); + self.append_history_item(&room, HItem::Service(format!("Join: <{}>", username))).await.unwrap(); } PushMessage::Message(msg) => { self.add_message(msg).await.unwrap(); } - PushMessage::Online{ sessions: _, user: _ } => {} + PushMessage::Online{ sessions: _, username: _ } => {} } } -- cgit v1.2.3-70-g09d2