|
|
@ -4,6 +4,8 @@ use mastodon_async::helpers::cli::authenticate; |
|
|
|
use mastodon_async::helpers::toml; |
|
|
|
use mastodon_async::helpers::toml; |
|
|
|
use mastodon_async::prelude::*; |
|
|
|
use mastodon_async::prelude::*; |
|
|
|
use mastodon_async::Result as MResult; |
|
|
|
use mastodon_async::Result as MResult; |
|
|
|
|
|
|
|
use paris::info; |
|
|
|
|
|
|
|
use paris::Logger; |
|
|
|
|
|
|
|
|
|
|
|
use std::fs::File; |
|
|
|
use std::fs::File; |
|
|
|
use std::io::{self, Write}; |
|
|
|
use std::io::{self, Write}; |
|
|
@ -77,10 +79,7 @@ async fn do_the_thing() -> MResult<()> { |
|
|
|
.. |
|
|
|
.. |
|
|
|
}, |
|
|
|
}, |
|
|
|
} => { |
|
|
|
} => { |
|
|
|
println!( |
|
|
|
let mut log = Logger::new(); |
|
|
|
"got a follow request from {} (@{})", |
|
|
|
|
|
|
|
account.display_name, account.acct |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut builder = StatusBuilder::new(); |
|
|
|
let mut builder = StatusBuilder::new(); |
|
|
|
builder |
|
|
|
builder |
|
|
@ -93,9 +92,20 @@ async fn do_the_thing() -> MResult<()> { |
|
|
|
|
|
|
|
|
|
|
|
let status = builder.build()?; |
|
|
|
let status = builder.build()?; |
|
|
|
|
|
|
|
|
|
|
|
client.new_status(status).await?; |
|
|
|
let res = client.new_status(status).await?; |
|
|
|
|
|
|
|
log.info(format!( |
|
|
|
|
|
|
|
"got a follow request from {} (@{})", |
|
|
|
|
|
|
|
account.display_name, account.acct |
|
|
|
|
|
|
|
)) |
|
|
|
|
|
|
|
.info(format!(" reply is at {}", res.uri)); |
|
|
|
} |
|
|
|
} |
|
|
|
_ => (), |
|
|
|
Event::Notification(n) => info!( |
|
|
|
|
|
|
|
"got other notification of type {:?} from @{}", |
|
|
|
|
|
|
|
n.notification_type, n.account.acct |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Event::Update(u) => info!("got update event: {:?}", u), |
|
|
|
|
|
|
|
Event::Delete(d) => info!("got delete event: {:?}", d), |
|
|
|
|
|
|
|
Event::FiltersChanged => info!("filters changed"), |
|
|
|
} |
|
|
|
} |
|
|
|
Ok(()) |
|
|
|
Ok(()) |
|
|
|
} |
|
|
|
} |
|
|
|