Skip to content

Commit

Permalink
fix(examples): send userstatus from echo server
Browse files Browse the repository at this point in the history
It's required by qtox now to make friend online.
  • Loading branch information
kurnevsky committed Jun 26, 2020
1 parent 69ddc92 commit ced5e54
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
},
0x18 => { // PACKET_ID_ONLINE
net_crypto_c.send_lossless(pk, vec![0x18]).map_err(Error::from).await?;
net_crypto_c.send_lossless(pk, b"\x30tox-rs".to_vec()).map_err(Error::from).await?;
Ok(())
net_crypto_c.send_lossless(pk, vec![0x32, 0x00]).map_err(Error::from).await?; // PACKET_ID_USERSTATUS
net_crypto_c.send_lossless(pk, b"\x30tox-rs".to_vec()).map_err(Error::from).await
},
0x40 => { // PACKET_ID_CHAT_MESSAGE
net_crypto_c.send_lossless(pk, packet).map_err(Error::from).await?;
Ok(())
net_crypto_c.send_lossless(pk, packet).map_err(Error::from).await
},
_ => Ok(()),
}
Expand Down

0 comments on commit ced5e54

Please sign in to comment.