|
|
|
@ -4,6 +4,8 @@ use mastodon_async::helpers::cli::authenticate;
@@ -4,6 +4,8 @@ use mastodon_async::helpers::cli::authenticate;
|
|
|
|
|
use mastodon_async::helpers::toml; |
|
|
|
|
use mastodon_async::prelude::*; |
|
|
|
|
use mastodon_async::Result as MResult; |
|
|
|
|
use paris::info; |
|
|
|
|
use paris::Logger; |
|
|
|
|
|
|
|
|
|
use std::fs::File; |
|
|
|
|
use std::io::{self, Write}; |
|
|
|
@ -77,10 +79,7 @@ async fn do_the_thing() -> MResult<()> {
@@ -77,10 +79,7 @@ async fn do_the_thing() -> MResult<()> {
|
|
|
|
|
.. |
|
|
|
|
}, |
|
|
|
|
} => { |
|
|
|
|
println!( |
|
|
|
|
"got a follow request from {} (@{})", |
|
|
|
|
account.display_name, account.acct |
|
|
|
|
); |
|
|
|
|
let mut log = Logger::new(); |
|
|
|
|
|
|
|
|
|
let mut builder = StatusBuilder::new(); |
|
|
|
|
builder |
|
|
|
@ -93,9 +92,20 @@ async fn do_the_thing() -> MResult<()> {
@@ -93,9 +92,20 @@ async fn do_the_thing() -> MResult<()> {
|
|
|
|
|
|
|
|
|
|
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(()) |
|
|
|
|
} |
|
|
|
|