aboutsummaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-09-17 23:54:13 +0200
committerTom Smeding <tom.smeding@gmail.com>2021-01-28 22:20:13 +0100
commit7466f90f3b50505431ec63e775b70dbac98f151d (patch)
tree5cb91461e50614c4003ee50faea67a1213ac4613 /rust
parenteb0d99941c9241aeda4159a3e622c38070bd1c6b (diff)
rust: Update to latest tomsg-rs
Diffstat (limited to 'rust')
-rw-r--r--rust/src/main.rs15
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: _ } => {}
}
}