mirror of
https://codeberg.org/steam-vent/chat.git
synced 2026-11-30 12:40:52 +01:00
update to steam-vent 0.6
This commit is contained in:
parent
e89a7da94a
commit
6f49aa5798
4 changed files with 387 additions and 53 deletions
|
|
@ -3,8 +3,8 @@ use std::error::Error;
|
|||
use std::io::stdin;
|
||||
use std::str::FromStr;
|
||||
use steam_vent::auth::{
|
||||
AuthConfirmationHandler, ConsoleAuthConfirmationHandler, DeviceConfirmationHandler,
|
||||
FileGuardDataStore, SharedSecretAuthConfirmationHandler,
|
||||
ClientInfo, ConsoleAuthConfirmationHandler, DeviceConfirmationHandler, FileGuardDataStore,
|
||||
SharedSecretAuthConfirmationHandler,
|
||||
};
|
||||
use steam_vent::{Connection, ServerList};
|
||||
use steam_vent_chat::{ChatClient, ChatEvent};
|
||||
|
|
@ -41,6 +41,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
&args.password,
|
||||
FileGuardDataStore::user_cache(),
|
||||
SharedSecretAuthConfirmationHandler::new(&secret),
|
||||
&ClientInfo::default(),
|
||||
)
|
||||
.await?
|
||||
}
|
||||
|
|
@ -50,7 +51,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
&args.username,
|
||||
&args.password,
|
||||
FileGuardDataStore::user_cache(),
|
||||
ConsoleAuthConfirmationHandler::default().or(DeviceConfirmationHandler),
|
||||
(
|
||||
ConsoleAuthConfirmationHandler::default(),
|
||||
DeviceConfirmationHandler,
|
||||
),
|
||||
&ClientInfo::default(),
|
||||
)
|
||||
.await?
|
||||
}
|
||||
|
|
@ -63,8 +68,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
while let Some(Ok(event)) = events.next().await {
|
||||
match event {
|
||||
ChatEvent::Typing(event) => println!("{} is tying...", event.source.steam64()),
|
||||
ChatEvent::Message(event) => println!("{}: {}", event.source.steam64(), event.message_no_bbcode.unwrap_or(event.message)),
|
||||
ChatEvent::EchoMessage(event) => println!("me: {}", event.message_no_bbcode.unwrap_or(event.message)),
|
||||
ChatEvent::Message(event) => println!(
|
||||
"{}: {}",
|
||||
event.source.steam64(),
|
||||
event.message_no_bbcode.unwrap_or(event.message)
|
||||
),
|
||||
ChatEvent::EchoMessage(event) => {
|
||||
println!("me: {}", event.message_no_bbcode.unwrap_or(event.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue