diff options
Diffstat (limited to 'rust/src')
-rw-r--r-- | rust/src/main.rs | 15 |
1 files changed, 7 insertions, 8 deletions
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<Self>, 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: _ } => {} } } |