Bump library versions
This commit is contained in:
parent
45401707c2
commit
bd71940364
3 changed files with 1380 additions and 711 deletions
2073
toot/Cargo.lock
generated
2073
toot/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,10 +1,10 @@
|
||||||
[package]
|
[package]
|
||||||
name = "toot"
|
name = "toot"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
authors = ["Stefan Schlott <stefan@ploing.de>"]
|
authors = ["Stefan Schlott <stefan@ploing.de>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
[dependencies.elefren]
|
[dependencies.elefren]
|
||||||
version = "0.14"
|
version = "0.22.0"
|
||||||
features = ["toml"]
|
features = ["toml"]
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use std::error::Error;
|
||||||
use elefren::prelude::*;
|
use elefren::prelude::*;
|
||||||
use elefren::helpers::toml; // requires `features = ["toml"]`
|
use elefren::helpers::toml; // requires `features = ["toml"]`
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error>> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let mastodon = if let Ok(data) = toml::from_file("mastodon-data.toml") {
|
let mastodon = if let Ok(data) = toml::from_file("mastodon-data.toml") {
|
||||||
Mastodon::from(data)
|
Mastodon::from(data)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -18,8 +18,10 @@ fn main() -> Result<(), Box<Error>> {
|
||||||
let status_text = args.get(1);
|
let status_text = args.get(1);
|
||||||
match status_text {
|
match status_text {
|
||||||
Some(text) => {
|
Some(text) => {
|
||||||
let mut status = StatusBuilder::new(text);
|
let status = StatusBuilder::new()
|
||||||
status.sensitive = Some(false);
|
.status(text)
|
||||||
|
.sensitive(false)
|
||||||
|
.build()?;
|
||||||
mastodon.new_status(status)?;
|
mastodon.new_status(status)?;
|
||||||
},
|
},
|
||||||
None => println!("No text to toot"),
|
None => println!("No text to toot"),
|
||||||
|
|
@ -28,10 +30,10 @@ fn main() -> Result<(), Box<Error>> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn register() -> Result<Mastodon, Box<Error>> {
|
fn register() -> Result<Mastodon, Box<dyn Error>> {
|
||||||
let registration = Registration::new("https://chaos.social")
|
let registration = Registration::new("https://chaos.social")
|
||||||
.client_name("toot-cli")
|
.client_name("toot-cli")
|
||||||
.scopes(Scopes::ReadWrite) // write:statuses would be sufficient. Scopes::Write didn't work
|
.scopes(Scopes::read_all() | Scopes::write_all()) // write:statuses would be sufficient. Scopes::Write didn't work
|
||||||
.build()?;
|
.build()?;
|
||||||
let url = registration.authorize_url()?;
|
let url = registration.authorize_url()?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue