diff --git a/Cargo.lock b/Cargo.lock index a7b5dce..b6e6237 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -972,7 +972,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "oolatoocs" -version = "1.3.1" +version = "1.4.0" dependencies = [ "clap", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index 0fa65d5..70884ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oolatoocs" -version = "1.3.1" +version = "1.4.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/lib.rs b/src/lib.rs index 6e6069e..c493b2c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,12 @@ pub async fn run(config: &Config) { .unwrap_or_else(|e| panic!("Cannot get instance: {}", e)); for toot in timeline { + // detecting tag #NoTweet and skipping the toot + if toot.tags.iter().any(|f| &f.name == "notweet") { + continue; + } + + // form tweet_content and strip everything useless in it let Ok(mut tweet_content) = strip_everything(&toot.content, &toot.tags) else { continue; // skip in case we can’t strip something };